| 
|
Readme file
SERIES
B
Statistical
Methodology
Marginal regression analysis of longitudinal data with time-dependent covariates: a generalized method-of-moments approach,
T. L. Lai and D. Small
Journal of the Royal Statistical Society, Series B, volume
69 (2007), part 1, pages 79 - 99
The data file 'philipp.child.data.txt' contains the data set used in the empirical study in Section 5. The data come from an International Food Policy Research Institute study that is described by H. E. Bouis and L. J. Haddad, Agricultural Commercialization, Nutrition and the Rural Poor: A Study of Philippine Farm Households, 1990, Lynne Rienner Publishers: Boulder. The data set is in ASCII, comma delimited format and contains the following variables:
Column 1: childid
Column 2: days sick in the past two weeks
Column 3: body mass index (BMI)
Column 4: gender (0=male, 1=female)
Column 5: age in months
Column 6: survey round
To read the data set into R, use the command
philippdata=read.table("philippchilddata.txt",header=TRUE,sep=",")
The file 'rprograms_timedependcov.txt' contains R functions that use a two-step generalized method of moments (GMM) to fit a linear model with time-dependent covariates. The functions assume that each unit is observed for T time periods. The data should be arranged into three matrices ymat, xmat, zmat, where ymat is an NxT matrix containing the outcome, with each unit's outcomes at times 1,..., T in a row; xmat is an Nx(T*number of time dependent covariates) matrix, with the rows arranged as first time dependent covariate for times 1,...,T for the unit, second time dependent covariate for times 1,...,T for the unit, ..., last time dependent covariate for times 1,...,T for the unit; zmat is an Nx(number of time-independent covariates), with each unit's time-independent covariates arranged in a row. The functions assume that an intercept is to be included in the model; the intercept should not be included in the time independent covariates.
To fit a two-step GMM model, the user must first classify the types of the time-dependent covariates (the function only allows type 2 or type 3) and use the function validmomcondticovfunc to specify which moment conditions will be considered. Then the user fits the two-step GMM model with the specified moment conditions using the function twostepgmmticovfunc. The other functions in the file need to be read into R in order for the function twostepgmmticovfunc to work. The function twostepgmmticovfunc outputs a list with three values:
betahat: the coefficient vector -- the ordering of the coefficients is the intercept, the time-dependent coefficients and the time-independent coefficients.
gmmobjmin: the value of the GMM objective function, i.e., Q_N(beta) in the paper
asycovest: the estimated covariance matrix of the estimates
Example: Suppose T=5 and there are 3 time-dependent covariates and 2 time-independent covariates, and the 3 time-dependent covariates are classified as Type 2, Type 3 and Type 2. We would fit the model by:
momsel=validmomcondticovfunc(5,c(1,0,1),2)
modelfit=twostepgmmticovfunc(ymat,xmat,zmat,momsel)
For more information, please contact:
Dylan Small
Department of Statistics
The Wharton School, University of Pennsylvania
400 Huntsman Hall, 3730 Walnut St.
Philadelphia, PA 19104
E-mail: dsmall@wharton.upenn.edu
|
Journals
SERIES
A
Statistics
in Society
SERIES
B
Statistical
Methodology
SERIES C
Applied Statistics
SERIES D
The
Statistician
|