knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This is a vignette for our package 'MIIPW'. It contains function for fitting GEE model for repeated measurement data. We have included mainly five function
We have included a repeated measured gene expression data in our package. Models are fitted to the dataset available in our package as below.
library(MIIPW) data("srdata1") head(srdata1) apply(srdata1,2,anyNA) mice::md.pattern(srdata1[,-c(1,2)],plot = TRUE)
Here we have considered the response model for C6kine, depending on the other covariates in dataset srdata1. Formula object below defines the model struture. Imputation model for the methods described in \link{MeanScore} can be specified through the predictor matrix function available in mice package.
formula<-C6kine~ActivinRIB+ActivinRIIA+ActivinRIIAB+Adiponectin+AgRP+ALCAM pMat<-mice::make.predictorMatrix(srdata1[names(srdata1)%in%all.vars(formula)]) m1<-MeanScore(data=srdata1, formula<-formula,id='ID', visit='Visit',family='gaussian',init.beta = NULL, init.alpha=NULL,init.phi=1,tol=.00001,weights = NULL, corstr = 'exchangeable',maxit=50,m=2,pMat=pMat) summary_meanscore(m1)
The summary_meanscore() and summary_ipw() summarises the results from fitted object obtained from meanscore and ipw functions. It provides the list of parameter estimates, wald statistics, p-value, phi value.
The inverse probability weighted method can be used through the function \code{SIPW,AIPW,miSIPW,miAIPW}. Similarly we need to specify a predictor matrix for the imputation of score fucntion missing due to incomplete data. The \code{pMat} argument takes the predictor matrix to be used in \link{mice} inside the function. The demo code for this model as follows :
m2<-SIPW(data=srdata1,formula<-formula,id='ID', visit='Visit',family='gaussian',corstr = 'exchangeable',maxit=5) m3<-AIPW(data=srdata1, formula<-formula,id='ID', visit='Visit',family='gaussian',init.beta = NULL, init.alpha=NULL,init.phi=1,tol=.00001,weights = NULL, corstr = 'exchangeable',maxit=50,m=3,pMat=pMat) m4<-miSIPW(data=srdata1, formula<-formula,id='ID', visit='Visit',family='gaussian',init.beta = NULL, init.alpha=NULL,init.phi=1,tol=0.001,weights = NULL, corstr = 'exchangeable',maxit=50,m=2,pMat=pMat) m1<-miAIPW(data=srdata1, formula<-formula,id='ID', visit='Visit',family='gaussian',init.beta = NULL, init.alpha=NULL,init.phi=1,tol=.00001,weights = NULL, corstr = 'exchangeable',maxit=4,m=2,pMat=pMat)
The \code{QICmiipw} function provides the list of various model selection criterion based on quasi liklihood. The demo code is as follows
m1<-MeanScore(data=srdata1, formula<-formula,id='ID', visit='Visit',family='gaussian',init.beta = NULL, init.alpha=NULL,init.phi=1,tol=.00001,weights = NULL, corstr = 'exchangeable',maxit=50,m=2,pMat=pMat) m11<-MeanScore(data=srdata1, formula<-formula,id='ID', visit='Visit',family='gaussian',init.beta = NULL, init.alpha=NULL,init.phi=1,tol=.00001,weights = NULL, corstr = 'independent',maxit=50,m=2,pMat=pMat) QICmiipw(model.R=m1,model.indep=m11,family="gaussian") ##
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.