Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/DatImputations.R
Imputes missing data using mice
1 2 | DatImputations(InitialData, ImputeSeed, NADes, DataFileNameS,
WhichCat, WhichImpute, WhichRowsImp, AllMethods)
|
InitialData |
dataframe of data to be used in model creation |
ImputeSeed |
the seed for imputations |
NADes |
the missing value designation |
DataFileNameS |
name of imputed data file |
WhichCat |
vector length of names of InitialData specifying '1' for categorical and '0' for continuous variable |
WhichImpute |
vector length of names of InitialData specifying '1' for Impute column and '0' for no Imputation |
WhichRowsImp |
vector length of number of rows of InitialData specifying '1' for Impute row and '0' for no Imputation |
AllMethods |
default is set at "logreg" for binary imputation "polr" for categorical imputation "pmm" for continuous |
this is a helper function for Initialize
when imputations are desired by user, and it should not be used as standalone function by regular user
No value is returned rather a new data set is saved
This function is best used by specificying the number of desired imputations with NumImpute in Initialize
William Terry
mice
https://cran.r-project.org/web/packages/mice/mice.pdf
mice
https://cran.r-project.org/web/packages/mice/mice.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
InitD=Simulate(MissingYN=1,exampleNum=1)
WhichCat=c(1,1,1,1,0)
WhichImpute=c(rep(1, ncol(InitD)))
WhichRowsImp=c(rep(1,nrow(InitD)))
AllMethods=c("logreg","polr","pmm")
Directry=getwd()
ImputeSeed=1000
TO=Directry
DataFileName="NewData_1000"
NameFile="New_1000"
TO=paste(TO,"/",NameFile,sep="")
DataFileNameS=paste0(TO,"/",DataFileName,".dat")
NADes=c(-99)
Initialize(InitD,NumImpute=1,WhichCat=c(1,1,1,1,0))
DatImputations(InitD,ImputeSeed,NADes,DataFileNameS,WhichCat,WhichImpute,WhichRowsImp,AllMethods)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.