Re: [R] Discrepant lm() and survreg() standard errors with weighted fits

2014-02-26 Thread Kyle Penner
I understand that the robust variances may lead to a different standard error. I want the standard error valid for heteroscedastic data, ultimately, because I have very good estimates of the measurement variances (why I'm doing weighted fits in the first place). For the simple example here, the W

Re: [R] Discrepant lm() and survreg() standard errors with weighted fits

2014-02-26 Thread Therneau, Terry M., Ph.D.
The robust variances are a completely different estimate of standard error. For linear models the robust variance has been rediscovered many times and so has lots of names: the White estimate in economics, the Horvitz-Thompson in surveys, working independence esitmate in GEE models, infinitesi

Re: [R] Discrepant lm() and survreg() standard errors with weighted fits

2014-02-25 Thread Kyle Penner
> Survreg treats weights as case weights, and lm treats them as sampling > weights. > Here is a simple example. Data set test2 has two copies of every obs in data > set test. > > > test <- data.frame(x=1:6, y=c(1,3,2,4,6,5)) > > test2 <- test[c(1:6, 1:6),] > > > summary(lm( y ~ x, data=test))$co

Re: [R] Discrepant lm() and survreg() standard errors with weighted fits

2014-02-25 Thread Thomas Lumley
On Tue, Feb 25, 2014 at 10:50 AM, Therneau, Terry M., Ph.D. < thern...@mayo.edu> wrote: > > > On 02/25/2014 05:00 AM, r-help-requ...@r-project.org wrote: > >> Hi, >> >> I have some measurements and their uncertainties. I'm using an >> uncensored subset of the data for a weighted fit (for now---I'

Re: [R] Discrepant lm() and survreg() standard errors with weighted fits

2014-02-25 Thread Therneau, Terry M., Ph.D.
On 02/25/2014 05:00 AM, r-help-requ...@r-project.org wrote: Hi, I have some measurements and their uncertainties. I'm using an uncensored subset of the data for a weighted fit (for now---I'll do a fit to the full, censored, dataset when I understand the results). survreg() reports a much sma

[R] Discrepant lm() and survreg() standard errors with weighted fits

2014-02-24 Thread Kyle Penner
Hi, I have some measurements and their uncertainties. I'm using an uncensored subset of the data for a weighted fit (for now---I'll do a fit to the full, censored, dataset when I understand the results). survreg() reports a much smaller standard error for the model parameter than lm(), but only