Sascha Sandragesan
2013-Jun-02 15:09 UTC
[R] Problem with package 'mi' for multiple imputation
Dear R-Community, I have just started using R (3.0.0) for my statistics and I find it the best programm for running my regressions. However, as I am still a junior user I soon came to the limit of my technical knowhow. Here's my situation: My dataset consists of 30 observations and 100 variables (numeric and factors). Some of the observations have missing values and as a result these observations will be omitted when running the regressions, which in turn reduces the sample. In order to counteract this, I have installed the package 'mi' for applying the method of multiple imputation. To reduce the structural problems in the data, I have corrected the variable types (i.e. numeric to factors and vice versa) and eliminated one observation, as it was an outlier and led to collinearity amongst some variables. To control for the problem of “contrasts can be applied only to factors with 2 or more levels” all factorvariables with only 1 level where excluded. Here's the information matrix: names include order number.mis all.mis type collinear 1 InvestmentYear Yes 1 1 No positive-continuous No 2 InvestmentSize Yes NA 0 No positive-continuous No 3 InvestmentSyndication Yes NA 0 No binary No 4 InvestmentRole Yes NA 0 No binary No 5 InvestmentExitYearAgreed Yes 2 7 No nonnegative No 6 InvestmentExitYearActual Yes 3 3 No nonnegative No 7 InvestmentExitStrategyAgreed Yes 4 5 No unordered-categorical No 8 InvestmentExitStrategyActual Yes 5 3 No unordered-categorical No 9 InvestmentAmountRL Yes 6 7 No continuous No 10 Sector Yes NA 0 No unordered-categorical No 11 BusinessStage Yes NA 0 No unordered-categorical No 12 Origin Yes 7 2 No unordered-categorical No 13 ManagementFoundingMember Yes NA 0 No binary No 14 ManagementFormerPC Yes NA 0 No binary No 15 ManagementFormerPCQuantity Yes NA 0 No ordered-categorical No 16 ManagementFormerPCSuccess Yes 8 1 No ordered-categorical No 17 ManagementCompositionCEO Yes 9 2 No ordered-categorical No 18 ManagementCompositionTechnical Yes 10 2 No ordered-categorical No 19 ManagementCompositionFinancial Yes 11 2 No binary No 20 ManagementCompositionScientific Yes 12 2 No ordered-categorical No 21 ManagementCompositionMarketing Yes 13 2 No fixed No 22 ManagementCompositionSales Yes 14 2 No fixed No 23 ManagementExperienceCEO Yes 15 6 No nonnegative No 24 ManagementExperienceTechnical Yes 16 7 No nonnegative No 25 ManagementExperienceFinancial Yes 17 6 No nonnegative No 26 ManagementExperienceScientific Yes 18 7 No nonnegative No 27 ManagementExperienceMarketing Yes 19 6 No binary No 28 ManagementExperienceSales Yes 20 6 No fixed No 29 ManagementExperienceStartup Yes 21 6 No ordered-categorical No 30 ManagementJointExperience Yes 22 6 No ordered-categorical No 31 ManagementDegreesNSBachelors Yes 23 2 No binary No 32 ManagementDegreesNSMasters Yes 24 2 No binary No 33 ManagementDegreesNSPhD Yes 25 2 No ordered-categorical No 34 ManagementDegreesNSProf Yes 26 2 No ordered-categorical No 35 ManagementDegreesEBachelors Yes 27 2 No fixed No 36 ManagementDegreesEMasters Yes 28 2 No binary No 37 ManagementDegreesEPhD Yes 29 2 No binary No 38 ManagementDegreesEProf Yes 30 2 No fixed No 39 ManagementAverageCompensation Yes 31 5 No nonnegative No 40 ManagementStockCompensation Yes NA 0 No unordered-categorical No 41 BoDMembers Yes NA 0 No nonnegative No 42 BoDCompsitionFounder Yes 32 1 No ordered-categorical No 43 BoDCompsitionInvestor Yes 33 1 No nonnegative No 44 BoDCompsitionExecutive Yes 34 1 No ordered-categorical No 45 BoDCompsitionOther Yes NA 0 No ordered-categorical No 46 ScientificBoardMembers Yes 35 6 No nonnegative No 47 FundsTotal Yes NA 0 No positive-continuous No 48 FundsResearch Yes NA 0 No positive-continuous No 49 FundsManufacturing Yes NA 0 No ordered-categorical No 50 FundsMarketing Yes NA 0 No fixed No 51 FundsOther Yes NA 0 No binary No 52 FundsCommittedCorporate Yes NA 0 No nonnegative No 53 FundsCommittedCorporateAmount Yes 36 3 No nonnegative No 54 FundsCommittedPrivate Yes NA 0 No nonnegative No 55 FundsCommittedPrivateAmount Yes 37 6 No nonnegative No 56 FundsCommittedFounder Yes 38 1 No ordered-categorical No 57 FundsCommittedFounderAmount Yes 39 2 No ordered-categorical No 58 FundsCommittedNone Yes NA 0 No binary No 59 GovernmentalAward Yes 40 2 No binary No 60 GovernmentalAwardAmount Yes 41 9 No nonnegative No 61 NonGovernmentalAward Yes 42 3 No binary No 62 NonGovernmentalAwardAmount Yes 43 3 No ordered-categorical No 63 Label Yes 44 2 No binary No 64 AdditionalFundsSource Yes NA 0 No fixed No 65 AdditionalFundsAmount Yes NA 0 No fixed No 66 Compounds Yes 45 1 No ordered-categorical No 67 DevelopmentStage1 Yes 46 2 No unordered-categorical No 68 Technology1 Yes 47 1 No binary No 69 DevelopmentStage2 Yes 48 1 No unordered-categorical No 70 Technology2 Yes 49 1 No binary No 71 DevelopmentStage3 Yes 50 2 No unordered-categorical No 72 Technology3 Yes 51 2 No binary No 73 DevelopmentStage4 Yes 52 1 No fixed No 74 Technology4 Yes 53 1 No fixed No 75 PendingPatents Yes 54 4 No nonnegative No 76 GrantedPatents Yes 55 1 No ordered-categorical No 77 Competition Yes 56 4 No nonnegative No 78 MarketSales Yes 57 4 No positive-continuous No 79 MarketPatients Yes 58 17 No nonnegative No 80 MarketGrowthRate Yes 59 8 No fixed No 81 CustomerBase Yes 60 1 No binary No 82 CustomerBaseAmount Yes NA 0 No ordered-categorical No 83 Collaboration Yes NA 0 No binary No 84 CollaborationOutsourcing Yes NA 0 No ordered-categorical No 85 CollaborationCooperation Yes NA 0 No ordered-categorical No 86 CollaborationStrategicAlliance Yes NA 0 No ordered-categorical No 87 CollaborationJointVenture Yes NA 0 No fixed No 88 CollaborationMerger Yes NA 0 No fixed No 89 CollaborationUniversity Yes NA 0 No ordered-categorical No 90 CollaborationCompany Yes NA 0 No ordered-categorical No 91 CollaborationConsulting Yes NA 0 No ordered-categorical No 92 CollaborationOther Yes NA 0 No ordered-categorical No Unfortunately I was not able to impute semi-continous data with transformation. When using the following code:>newdata<-mi.preprocess(ISC)and>IMP <- mi(newdata, preprocess = FALSE)the following error message resulted: "Fehler in .local(object, ...) : unbenutztes Argument (preprocess = FALSE)" I have searched for an answer, but until now I didn't found any. It seems like the argument does not apply to this objecte, but as mentioned in the package description it should be a valid argument. Anyhow, I have performed the default function of mi() to check my data:>IMP <- mi(ISC) , where ISC is the data frame. Furthermore, the defaul arguments of the function are as follows (source: http://127.0.0.1:31868/library/mi/html/mi.html):object A data frame or an mi object that contains an incomplete data. mi identifies NAs as the missing data. info The mi.info<http://127.0.0.1:31868/library/mi/help/mi.info> object. n.imp The number of multiple imputations. Default is 3 chains. n.iter The maximum number of imputation iterations. Default is 30 iterations. R.hat The value of the R.hat statistic used as a convergence criterion. Default is 1.1. max.minutes The maximum minutes to operate the whole imputation process. Default is 20 minutes. rand.imp.method The methods for random imputation. Currently, mi implements only the boostrap method. run.past.convergence Default is FALSE. If the value is set to be TRUE, mi will run until the values of either n.iter or max.minutes are reached even if the imputation is converged. seed The random number seed. check.coef.convergence Default is FALSE. If the value is set to be TRUE, mi will check the convergence of the coefficients of imputation models. add.noise A list of parameters for controlling the process of adding noise to mi via noise.control<http://127.0.0.1:31868/library/mi/help/noise.control>. Unfortuntely, the imputation stops after the first chain (imputation) of the first iteration and does not show an error message (by default the imputation process shoud run over 30 iterations including 3 chains each): "> IMP <- mi(ISC) Beginning Multiple Imputation ( Sun Jun 02 16:44:41 2013 ): Iteration 1 Chain 1 : InvestmentYear* InvestmentExitYearAgreed* InvestmentExitYearActual* InvestmentExitStrategyAgreed* InvestmentExitStrategyActual* InvestmentAmountRL* Origin* ManagementFormerPCSuccess* ManagementCompositionCEO* ManagementCompositionTechnical* ManagementCompositionFinancial* ManagementCompositionScientific* ManagementCompositionMarketing* ManagementCompositionSales* ManagementExperienceCEO* ManagementExperienceTechnical* ManagementExperienceFinancial* ManagementExperienceScientific* ManagementExperienceMarketing* ManagementExperienceSales* ManagementExperienceStartup* ManagementJointExperience* ManagementDegreesNSBachelors* ManagementDegreesNSMasters* ManagementDegreesNSPhD* ManagementDegreesNSProf* ManagementDegreesEBachelors* ManagementDegreesEMasters* ManagementDegreesEPhD* ManagementDegreesEProf* ManagementAverageCompensation* BoDCompsitionFounder* BoDCompsitionInvestor* BoDCompsitionExecutive* ScientificBoardMembers* FundsCommittedCorporateAmount* FundsCommittedPrivateAmount* FundsCommittedFounder* FundsCommittedFounderAmount* GovernmentalAward* GovernmentalAwardAmount* NonGovernmentalAward* NonGovernmentalAwardAmount* Label* Compounds* DevelopmentStage1* Technology1* DevelopmentStage2* Technology2* DevelopmentStage3* Technology3* DevelopmentStage4* Technology4* PendingPatents* GrantedPatents* Competition* MarketSales* MarketPatients* MarketGrowthRate* CustomerBase*>"My questions: Does the mi(ISC) need the specification of the mi.preprocess(ISC)? If so, how can i fix the error "Fehler in .local(object, ...) : unbenutztes Argument (preprocess = FALSE)"? Did I mispecify the mi(ISC) or why does it stop without providing an error message and how can i solve this? Many thanks in advance for your highly appreciated support on this matter. So far, I have intensivelly searched for solving this problem, but could not find any solution. Best regards, Sascha [[alternative HTML version deleted]]