seqimpute {seqimpute} | R Documentation |
Imputation of missing data present in a dataset through the prediction based
on either a multinomial, a linear or an ordinal regression model.
In order to specify even more the prediction, fixed as well as time-dependant
covariates be included in the model.
The prediction of the missing values is based on the theory of Prof. Brendan
Halpin. It considers a various amount of surrounding available information to
perform the prediction process.
In fact, we can among others specify np
(the number of past variables
taken into account) and nf
(the number of future information taken
into account).
seqimpute( OD, regr = "mlogit", k, np = 1, nf = 0, nfi = 1, npt = 1, available = TRUE, CO = matrix(NA, nrow = 1, ncol = 1), COt = matrix(NA, nrow = 1, ncol = 1), pastDistrib = FALSE, futureDistrib = FALSE, mi = 1, mice.return = FALSE, include = FALSE, noise = 0 )
OD |
|
regr |
|
k |
|
np |
|
nf |
|
nfi |
|
npt |
|
available |
|
CO |
|
COt |
|
pastDistrib |
|
futureDistrib |
|
mi |
|
mice.return |
If |
include |
|
noise |
|
The imputation process is divided into several steps. According to the location of the gaps of NA among the original dataset, we have defined 5 types of gaps:
- Internal Gaps (simple usual gaps)
- Initial Gaps (gaps situated at the very beginning of a sequence)
- Terminal Gaps (gaps situaed at the very end of a sequence)
- Left-hand side SLG (Specially Located Gaps) (gaps of which the beginning location is included in the interval [0,np]
)
- Right-hand side SLG (Specially Located Gaps) (gaps of which the ending location is included in the interval [ncol(OD)-nf,ncol(OD)]
)
Order of imputation of the gaps types: 1. Internal Gaps 2. Initial Gaps 3. Terminal Gaps 4. Left-hand side SLG 5. Right-hand side SLG
Returns either an S3 object of class mids
if mice.return = TRUE
or a dataframe, where the imputed dataset are stacked vertically. In the second case,
two columns are added: .imp
integer that refers to the imputation number
(0 corresponding to the original dataset if include=TRUE
) and .id
character corresponding to
the rownames of the dataset to impute.
Andre Berchtold <andre.berchtold@unil.ch> Kevin Emery
HALPIN, Brendan, March 2013. Imputing Sequence Data : Extensions to initial and terminal gaps, Stata's mi. Unviversity of Limerick Department of Sociology Working Paper Series. Working Paper WP2013-01, p.3. Available at : http://www.ul.ie/sociology/pubs/wp2013-01.pdf
## Not run: data(OD, CO, COt) RESULT <- seqimpute(OD=OD, k=2, np=1, nf=0, nfi=1, npt=1, CO=CO, COt=COt, mi=1) ## End(Not run)