DatImputations: Impute Data

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/DatImputations.R

Description

Imputes missing data using mice

Usage

1
2
DatImputations(InitialData, ImputeSeed, NADes, DataFileNameS, 
WhichCat, WhichImpute, WhichRowsImp, AllMethods)

Arguments

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

Details

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

Value

No value is returned rather a new data set is saved

Note

This function is best used by specificying the number of desired imputations with NumImpute in Initialize

Author(s)

William Terry

References

mice https://cran.r-project.org/web/packages/mice/mice.pdf

See Also

mice https://cran.r-project.org/web/packages/mice/mice.pdf

Examples

 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)

PathSelectMP documentation built on May 2, 2019, 3:15 a.m.