Weighted regression in rms/Hmisc

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Weighted regression in rms/Hmisc

Mullah Abu Shadeque
Hi all, 

While using  the following package and code: 
 
library(rms)
library(Hmisc)
test.trans<-aregImpute(
~ NearestWeekGestation + MaternalBMI + MomAge_Years +  
                       WtGain + ethnicity , n.impute=10
,data=data.1)
 
 test.mod<-fit.mult.impute(BirthWeight_g ~ rcs(NearestWeekGestation,4)
+   
           rcs(MaternalBMI,4) + rcs(MomAge_Years,4)
+ rcs(WtGain,4) + ethnicity   
           ,fitter=ols,xtrans=test.trans,data=data.1)
 
 
How
can I specify for weighted OLS here where I have a defined weight vector w?
 
I
would be highly helped and grateful to you if you kindly reply to my mail.
 
With
Regards,
SADIK  
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Weighted regression in rms/Hmisc

Frank Harrell
You should be able to pass a weights argument through fit.mult.impute to ols.  I assume that weights are with respect to variables that you, for some reason, do not want to have as predictors.  Otherwise you are already conditioning on the weighting factors and no weights are needed.
Frank
Mullah Abu Shadeque wrote
Hi all, 

While using  the following package and code: 
 
library(rms)
library(Hmisc)
test.trans<-aregImpute(
~ NearestWeekGestation + MaternalBMI + MomAge_Years +  
                       WtGain + ethnicity , n.impute=10
,data=data.1)
 
 test.mod<-fit.mult.impute(BirthWeight_g ~ rcs(NearestWeekGestation,4)
+   
           rcs(MaternalBMI,4) + rcs(MomAge_Years,4)
+ rcs(WtGain,4) + ethnicity   
           ,fitter=ols,xtrans=test.trans,data=data.1)
 
 
How
can I specify for weighted OLS here where I have a defined weight vector w?
 
I
would be highly helped and grateful to you if you kindly reply to my mail.
 
With
Regards,
SADIK  
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Frank Harrell
Department of Biostatistics, Vanderbilt University