search for: imp1

Displaying 6 results from an estimated 6 matches for "imp1".

Did you mean: imp
2010 Aug 10
1
Multiple imputation, especially in rms/Hmisc packages
...they match the fitted values of the last imputation. For example, library(rms) set.seed(1) x1 <- rnorm(40) x2 <- 0.5*x1 + rnorm(40,0,3) y <- x1^2 + x2 + rnorm(40,0,3) x2[40] <- NA # create 1 missing value in x2 a <- aregImpute(~ y + x1 + x2, n.impute=2, nk=3) # 2 imputations x2.imp1 <- x2; x2.imp1[40] <- a$imputed$x2[,1] # first imputed x2 vector x2.imp2 <- x2; x2.imp2[40] <- a$imputed$x2[,2] # second imputed x2 vector ols.imp1 <- ols(y ~ rcs(x1,3) + x2.imp1) # model on imputation 1 ols.imp2 <- ols(y ~ rcs(x1,3) + x2.imp2) # model on imputation 2 d <...
2012 Apr 25
2
Accessing a list
Hi, I have the following problem- I want to access a list whose elements are imp1, imp2, imp3 etc I tried theusing the paste comand in a for loop see the last for loop below. But I keep calling it df but df = imp1 (for the first run). Any ideas on how I can access the elements of the list? Isaac require(Amelia) library(Amelia) data.use <- read.csv("multiplecarol.CSV&...
2013 Jan 28
6
Thank you your help.
Hi, temp3<- read.table(text=" ID CTIME WEIGHT HM001 1223 24.0 HM001 1224 25.2 HM001 1225 23.1 HM001 1226 NA HM001 1227 32.1 HM001 1228 32.4 HM001 1229 1323.2 HM001 1230 27.4 HM001 1231 22.4236 #changed here to test the previous solution ",sep="",header=TRUE,stringsAsFactors=FALSE) ?tempnew<- na.omit(temp3) ?grep("\\d{4}",temp3$WEIGHT) #[1] 7 9 #not correct
2012 May 09
0
Failed Convergence when using mi to generate synthetic data
...emptydiamonds1[,j] <- NA } #throw up a dummy variable for imputation diamonds1$impute=0 emptydiamonds1$impute=1 #package the two into one dataset d2 <-rbind(diamonds1, emptydiamonds1) str(d2) #run in.info miinfo <-mi.info(d2) #pre_process mi_pre <-mi.preprocess(d2) #impute Imp1 <-mi(mi_pre, n.iter=49) [[alternative HTML version deleted]]
2012 Oct 03
0
calculating gelman diagnostic for mice object
...ltiple imputation and would like to use the gelman diagnostic in -coda- to assess the convergence of my imputations. However, gelman.diag requires an mcmc list as input. van Buuren and Groothuis-Oudshoorn (2011) recommend running mice step-by-step to assess convergence (e.g. imp2 <- mice.mids(imp1, maxit = 3, print = FALSE) ) but this creates mids objects. How can I convert the mids objects into an mcmc list? Or is the step-by-step approach wrong here? thanks, Rachel [[alternative HTML version deleted]]
2012 Oct 26
0
combined output with zelig is not working!?!
...l. I have checked previous queries about combining MI datasets and they are quite dated and none really related to my problem. I have been tirelessly working with zelig and unfortunately i am getting real stuck! here is my R code: ###these are my 5 imputed datasets#### d.1 <- read.table("imp1.csv", header=TRUE,sep=",") d.2 <- read.table("imp2.csv", header=TRUE,sep=",") d.3 <- read.table("imp3.csv", header=TRUE,sep=",") d.4 <- read.table("imp4.csv", header=TRUE,sep=",") d.5 <- read.table("imp5.csv...