You can use the missing data library.
If you have the imputations, you can do the following from the missing
library:
1. Run you linear model for each set of imputations and put into a list:
fit<-list(fit1,fit2,...,fit20)
2. Make the list a miList:
fit<-miList(fit) ###
3. Generate the average estimates, and compute combined standard errors or
covariance estimates from multiple analyses on imputed data:
miMeanSE(fit) ###
The accuracy of the results depend on your model assumptions, that the joint
distribution of the covariates and response is multivariate normal and the
missing data are missing at random, that is the distribution (or pattern) of
the missing data is only a function of the observed data.
In using the Splus package missing, one may also use impGauss generate the
imputations.
Here is a complete example using the missing library starting with the raw
cholesterol data.
cholesterol.em <- emGauss(cholesterol) ###Fits em algorithm
tmp<-impGauss(cholesterol.em, nimpute = 100) ###100 imputations using fit
fit <- miEval(lm(chol14~., data = tmp)) ###100 fits using
imputations
miMeanSE(fit) ###Means and SE
I hope this helps with your missing data model.
If all else fails, try a Bayesian package such a WinBUGS
http://mathstat.helsinki.fi/openbugs/
Hope this helps
Dr. Thomas H Jagger
FSU department of Geography
Research Consultant
>Dear S folks,
>
>I occasionally use S plus with the menu and wonder if anyone's willing to
>share a few lines of code to solve the following task, which is essentially
>data management.
>
>I have twenty imputed datasets because my original data had 20% missing
>data which looks to be MAR using the ISNI index of Troxell et al. I want to
>bootstrap the coefficients of a model that will be fit to each of the
>twenty imputed datasets. The logical approach seems to be to bootstrap each
>of the 20 datasets and then combine all the output and take the grand mean
>and grand percentiles to construct the final bootstrap estimate and
>confidence intervals.
>
>The bootstrap command from the point and click menu works like this:
>
>coef(lm(response~predictor, data.frame))
>
>What I want to to do is run the bootstrap function for twenty different
>data sets that are combined in one data file, and indexed with a variable
>called _imputation_ = 1,2, ..., 20.
>
>Any ideas in how I might code this in S plus?
>
>Thanks in advance for your help.
>
>Terrence E. Murphy, Ph.D.
>Program on Aging
>Yale University
>1 Church St., 7th Floor
>New Haven, CT 06437
>terrence.murphy@yale.edu
>phone: 203-764-9805
>fax: 203-764-9831
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
|