Re: [R] Extracting sentences with combinations of target words/terms from cancer patient text medical records

2017-07-13 Thread Robert McGehee
use the PCRE regex library anyway. However, as this is basically what you did, I'm not sure why you're not happy with your existing approach. -Original Message- From: Paul Miller [mailto:pjmiller...@yahoo.com] Sent: Thursday, July 13, 2017 3:01 PM To: Robert McGehee Cc

Re: [R] Extracting sentences with combinations of target words/terms from cancer patient text medical records

2017-07-12 Thread Robert McGehee
Hi Paul, Sounds like you have your answer, but for fun I thought I'd try solving your problem using only a regular expression query and base R. I believe this works: > txt <- "Patient had stage IV breast cancer. Nothing matches this sentence. > Metastatic and breast match this sentence. French

[R] Estimating Unbiased Standard Deviation with Autocorrelation

2017-06-15 Thread Robert McGehee
Hello, I have a vector of values with significant autocorrelation, and I want to calculate an unbiased standard deviation that adjusts for the autocorrelation. The formula linked below purports to provide what I want: https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation#Effect

Re: [R] Regression with factor having1 level

2016-03-11 Thread Robert McGehee
;,"B"))) lmresid(y~x1+x2, data=df) resid(lm(y~x1, data=df, na.action=na.exclude)) --Robert PS, Peter, wasn't sure if you also meant to add comments, but they didn't come through. On Fri, Mar 11, 2016 at 3:40 AM, peter dalgaard wrote: > >> On 11 Mar 2016, at 02:03 ,

Re: [R] Regression with factor having1 level

2016-03-10 Thread Robert McGehee
in NAs. I'm currently leaning towards rewriting model.matrix.default so that it removes offending terms rather than give an error, but if someone has done this already (or something more elegant), that would of course be preferred :) --Robert On Thu, Mar 10, 2016 at 7:39 PM, David Winsemi

[R] Regression with factor having1 level

2016-03-10 Thread Robert McGehee
Hello R-helpers, I'd like a function that given an arbitrary formula and a data frame returns the residual of the dependent variable, and maintains all NA values. Here's an example that will give me what I want if my formula is y~x1+x2+x3 and my data frame is df: resid(lm(y~x1+x2+x3, data=df, na.