[R] Weighted regression in rms/Hmisc

Frank Harrell f.harrell at vanderbilt.edu
Sun May 19 15:45:01 CEST 2013


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]]
> 
> 
> ______________________________________________

> R-help@

>  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
--
View this message in context: http://r.789695.n4.nabble.com/Weighted-regression-in-rms-Hmisc-tp4667437p4667446.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list