wtsc.wrapper {weightedScores}R Documentation

THE WEIGHTED SCORES METHOD WITH INPUTS OF THE DATA

Description

The weighted scores method with inputs of the data.

Usage

wtsc.wrapper(xdat,ydat,id,tvec,margmodel,corstr,link,iprint=FALSE)
wtsc.ord.wrapper(xdat,ydat,id,tvec,corstr,link,iprint=FALSE)

Arguments

xdat

(x1,x2,,xn)(\mathbf{x}_1 , \mathbf{x}_2 , \ldots , \mathbf{x}_n )^\top, where the matrix xi,i=1,,n\mathbf{x}_i,\,i=1,\ldots,n for a given unit will depend on the times of observation for that unit (jij_i) and will have number of rows jij_i, each row corresponding to one of the jij_i elements of yiy_i and pp columns where pp is the number of covariates including the unit first column to account for the intercept (except for ordinal regression where there is no intercept). This xdat matrix is of dimension (N×p),(N\times p), where N=i=1njiN =\sum_{i=1}^n j_i is the total number of observations from all units.

ydat

(y1,y2,,yn)(y_1 , y_2 , \ldots , y_n )^\top, where the response data vectors yi,i=1,,ny_i,\,i=1,\ldots,n are of possibly different lengths for different units. In particular, we now have that yiy_i is (ji×1j_i \times 1), where jij_i is the number of observations on unit ii. The total number of observations from all units is N=i=1njiN =\sum_{i=1}^n j_i. The ydat are the collection of data vectors yi,i=1,,ny_i, i = 1,\ldots,n one from each unit which summarize all the data together in a single, long vector of length NN.

id

An index for individuals or clusters.

tvec

A vector with the time indicator of individuals or clusters.

margmodel

Indicates the marginal model. Choices are “poisson” for Poisson, “bernoulli” for Bernoulli, and “nb1” , “nb2” for the NB1 and NB2 parametrization of negative binomial in Cameron and Trivedi (1998).

corstr

Indicates the latent correlation structure of normal copula. Choices are “exch”, “ar”, and “unstr” for exchangeable, ar(1) and unstructured correlation structure, respectively.

link

The link function. Choices are “log” for the log link function, “logit” for the logit link function, and “probit” for the probit link function.

iprint

Indicates printing of some intermediate results, default FALSE

Details

This wrapper functions handles all the steps to obtain the weighted scores estimates and standard errors.

Value

A list containing the following components:

IEEest

The estimates of the regression and not regression parameters ignoring dependence.

CL1est

The vector with the CL1 estimated dependence parameters (latent correlations).

CL1lik

The value of the sum of bivariate marginal log-likelihoods at CL1 estimates.

WSest

The weighted score estimates of the regression and not regression parameters.

asympcov

The estimated weighted scores asymptotic covariance matrix.

Author(s)

Aristidis K. Nikoloulopoulos A.Nikoloulopoulos@uea.ac.uk
Harry Joe harry.joe@ubc.ca

References

Nikoloulopoulos, A.K., Joe, H. and Chaganty, N.R. (2011) Weighted scores method for regression models with dependent data. Biostatistics, 12, 653–665. doi: 10.1093/biostatistics/kxr005.

Nikoloulopoulos, A.K. (2016) Correlation structure and variable selection in generalized estimating equations via composite likelihood information criteria. Statistics in Medicine, 35, 2377–2390. doi: 10.1002/sim.6871.

Nikoloulopoulos, A.K. (2017) Weighted scores method for longitudinal ordinal data. Arxiv e-prints, <arXiv:1510.07376>. https://arxiv.org/abs/1510.07376.

See Also

wtsc, solvewtsc, weightMat

Examples


################################################################################
#                      read and set up the data set
################################################################################
data(childvisit)
# covariates
season1<-childvisit$q
season1[season1>1]<-0
xdat<-cbind(1,childvisit$sex,childvisit$age,childvisit$m,season1)
# response
ydat<-childvisit$hosp
#id
id<-childvisit$id
#time
tvec<-childvisit$q
################################################################################
out<-wtsc.wrapper(xdat,ydat,id,tvec,margmodel="nb1",corstr="ar",iprint=TRUE)

################################################################################
#                        transform to binary responses                         #
################################################################################
y2<-ydat
y2[ydat>0]<-1
################################################################################
out<-wtsc.wrapper(xdat,y2,id,tvec,margmodel="bernoulli",link="probit",
corstr="exch",iprint=TRUE)
################################################################################
#                        via the code for ordinal                             #
################################################################################
out<-wtsc.ord.wrapper(xdat[,-1],2-y2,id,tvec,link="probit",
corstr="exch",iprint=TRUE)


[Package weightedScores version 0.9.5.3 Index]