Most importantly, I'd first look at what type of these variables are (ie, count vs continuous vs ordinal, etc.), plus the distribution of each. This should provide you with the information for how to code them using IVEware for MI. Additional responses in [] below. -Craig
>>> [email protected] 09/27/06 6:11 PM >>> Hi all, I need some clarifications on variable types and their specification in IVEWARE. I would appreciate any help with this. I have 3 types of 'count/continuous/mixed' variables - these are all non-negative integer values - in addition they all have legitimate skips- e.g. A- has values from 1 to 24.... (Count?) B- has values from 0 to 1000.....( should this be considered a count or continuous given the range?) C- has values from 0 to 100 with over 20% =0... ( Mixed?) I recall having some problem previously with B- about there being too many categories- if we regard B as continuous how will we deal with '0'- given legitimate skips are set to zero for continuous variables? [Not sure exactly what you mean by "skips," but there should not be a problem using 0 for a continuous term unless you intend to log transform it before MI.] Would I specify them in the impute program as follows: Default Categorical; Count A; Continuous B; Mixed C; [if this fits with the type of variables you have for A, B, and C, then this should work.] Would I specify the bounds statement as follows e.g. A- is number of hours - so values should only be between 1 and 24. Bounds A (1 < 24) B (0 < 1000) C (0 <100) [Yes, the bounds should represent the range of plausible values to be imputed. I usually write the IVEware bounds as e.g., (>=1, <=24). Will the legitimate skips be coded to one higher than the last value as follows: A-25 B-1001 C-101 [Again, not sure what is meant by "skips." Are these missing values or gaps in the range of the variable that are not represented in the sample?] Thanks Mah-J _______________________________________________ Impute mailing list [email protected] http://lists.utsouthwestern.edu/mailman/listinfo/impute -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.utsouthwestern.edu/pipermail/impute/attachments/20060928/681d8777/attachment.htm From N.Smits <@t> psy.vu.nl Fri Sep 29 03:31:47 2006 From: N.Smits <@t> psy.vu.nl (Niels Smits) Date: Fri Sep 29 03:32:14 2006 Subject: [Impute] Solution to the Error in R code for multiparameter method In-Reply-To: <[email protected]> References: <[email protected]> Message-ID: <[email protected]> Sorry to have bothered you with this problem. I interpreted a matrix as a scalar, which caused the problem. For those who are interested, below you find the corrected code, which produces indentical outcomes to those of the multiparameter MI-inference in Norm for Windows. cheers Niels ############ #correct R-code ############ mi.inferencemp<-function (est, cov.mat) { qstar <- est[[1]] for (i in 2:length(est)) { qstar <- cbind(qstar, est[[i]]) } qbar <- apply(qstar, 1, mean) u <- as.vector(cov.mat[[1]]) for (i in 2:length(cov.mat)) { u <- cbind(u, as.vector(cov.mat[[i]])) } ubar <- matrix(apply(u, 1, mean),nrow=length(est[[1]])) m <- dim(qstar)[2] ss <- as.vector((est[[1]] - qbar) %*% t((est[[1]] - qbar))) for (i in 2:m) { ss <- cbind(ss,as.vector((est[[i]] - qbar) %*% t((est[[i]] - qbar)))) } bm <- matrix(apply(ss, 1, sum),nrow = length(est[[1]]))/(m-1) k <- nrow(ubar) rem <- (1 + (1/m)) * sum(diag(bm%*%solve(ubar)))/k tm <- (1 + rem) * ubar t <- k * (m-1) if (t > 4) nu1 <- 4 + (t-4) * (1 + (1-2/t)/rem)^2 else nu1 <- 0.5 * t * (1 + 1/k) * (1 + 1/rem)^2 D1 <- (t(t(solve(tm))%*%qbar)%*%qbar) * 1/k pval <- 1 - pf(D1, k, nu1) fminf <- rem/(rem + 1) qbarse<- result <- list(est = qbar, std.err = sqrt(diag(tm)), cov.mat = tm, F = D1, df1 = k, df2 = nu1, signif = pval, r = rem, fminf = fminf) result } Niels Smits Research Methodology, Statistics and Data-analysis Faculty of Psychology and Education Free University Amsterdam Van der Boechorststraat 1 1081 BT Amsterdam The Netherlands Tel: +31 (0)20 5988713 Secr: +31 (0)20 5988757 Fax: +31 (0)20 5988758 Niels Smits wrote: > Hello Everybody, > > I do a lot of imputing for applied researchers. I use the excellent > norm library in R. Now I wish to perform ANOVAs (regressions on > dummies) on imputed files and have to pool the multiple outcomes. > Unfortunately, unlike the Windows version of Norm, the R library does > not contain a procedure for the multiparameter method. I am working on > an R-version of the procedure myself. To that end I have been studying > the Li, Raghunathan, & Rubin (1991) JASA article, the 1997 book by > Schafer (par 4.3.3), and the comprehensive help function in the > Windows version of Norm. To test my own procedure I performed a > multiparameter MI-inference within the Windows version of Norm as well. > First I had to overcome several difficulties: > > A Schafer's book, page 114 and the help function in Norm differ in > the reported estimate of the total covariance matrix. The book seems > to contain an error, it should be (in tex code) > \tilde{T}=(1+r_1)\bar{U} instead of \tilde{T}=(1-r_1)\bar{U} (so, the > minus should be a plus). > B In the help function, the r=(1+m^-1)tr(B\bar{U} should also be > divided by k. > > Then, the outcomes of my procedure (code is added in the appendices) > and Windows-Norm' differed. Moreover, when using Meng & Rubins (1992) > D3 statistic, which I also programmed, the outcomes were very similar > to those of Norm in windows. After staring at my R-code for hours I > still think it is okay; I followed the Li et al formula's, but the > code must be wrong somehow. > > My question is the following: > > Does anybody see a flaw in the R-code for the mimd.inferende function > (mi-inference for multidimensional estimands) below? In addition, does > anybody have an example for which the multiparameter is valid so I can > test my R-procedure? > > > > > >
