Learn R Programming

isni (version 0.1)

isniglm: Function for ISNI computation when the outcome follows GLMs.

Description

Calculate the ISNI when the regression outcome is subject to missingness and follows generalized linear models (GLMs)

Usage

isniglm(ymodel, gmodel, ydist = "gaussian", alldata, flag = 0)

Arguments

ymodel

an object of class "formula": a symbolic description of the model to be fitted for the outcome

gmodel

an object of class "formula": a symbolic description of the selection model to be fitted for the missingness indictor g

ydist

a description of the error distribution to be used in the GLM for the outcome y

alldata

the name of data frame containing all the variables in the model and all the observations including those intended to be collected but became missing.

flag

an indicator of using log link (instead of inverse) for Gamma distribution

Examples

Run this code
# NOT RUN {
   ## load data set
   data(r99)

   ymodel= y ~ gender+fac+genderbyfac

   print(summary(glm(ymodel,family=binomial(link=logit), data=r99, subset=g==0)))

   gmodel= g~gender+fac+genderbyfac
   isnicSBsurvey<-isniglm(ymodel,gmodel=gmodel,ydist='binomial', alldata=r99)
   summary(isnicSBsurvey)
# }

Run the code above in your browser using DataLab