Package 'cglm'

Title: Fits Conditional Generalized Linear Models
Description: Estimates the ratio of the regression coefficients and the dispersion parameter in conditional generalized linear models for clustered data.
Authors: Arvid Sjolander
Maintainer: Arvid Sjolander <[email protected]>
License: GPL (>= 2)
Version: 1.1
Built: 2024-11-26 06:25:36 UTC
Source: CRAN

Help Index


Estimates the ratio of the regression coefficients and the dispersion parameter in conditional generalized linear models for clustered data.

Description

cglm estimates the ratio of the regression coefficients and the dispersion parameter in conditional generalized linear models. This is of particular interest in the so-called case-time-control design.

Usage

cglm(method, formula, data, id, link, ...)

Arguments

method

a string specifying the desired estimation method; either "ts" for two-step estimation, or "cml" for conditional maximum likelihood estimation.

formula

a symbolic description of the model to be fitted.

data

a data frame containing the variables in the model.

id

a string containing the name of the cluster identification variable.

link

a string specifying the desired link function. This argument is not used when method="cml".

...

optional arguments passed on to the nleqslv function or the optim function, which are used to solve the estimating equations when method="ts" and method="cml", respectively. See the help pages for nleqslv and optim.

Details

Let yijy_{ij} and xijx_{ij} be the outcome and covariate(s) for subject jj in cluster ii, respectively. Consider the conditional generalized linear model

p(yiji,xij)=exp[θijyijA(θij)ϕ+k(yij,ϕ)]p(y_{ij}|i,x_{ij})=\textrm{exp}\left[\frac{\theta_{ij}y_{ij}-A(\theta_{ij})}{\phi}+k(y_{ij},\phi)\right]

where

θij=η{E(yijxij)}=bi+βxij.\theta_{ij}=\eta\{E(y_{ij}|x_{ij})\}=b_i+\beta x_{ij}.

cglm estimates the ratio

β/ϕ.\beta / \phi.

This ratio is of particular interest in so-called case-time-control designs; see Sjolander (2016) and Sjolander and Ning (2018) for details. Two estimation methods are allowed; the two-step method proposed by Sjolander (2016) and the conditional maximum likelihood method proposed by Sjolander and Ning (2018).

Value

An object of class "cglm" is a list containing

call

the matched call.

coefficients

the ratio of the estimated coefficients and the estimated dispersion parameter.

var

the variance-covariance matrix.

convergence

was a solution found to the estimating equations?

Note

Missing data are not allowed.

Author(s)

Arvid Sjolander.

References

Sjolander A. (2017). The case-time-control method for non-binary exposures. Sociological Methodology 47(1), 182-211.

Sjolander A., Ning Y. (2018). A general and robust estimation method for the case-time-control design. Sociological Methodology 49(1), 349-365.

Examples

data(teenpov)

fit.ide <- cglm(method="ts", formula=hours~nonpov+inschool+spouse+age+mother, 
  data=teenpov, id="ID", link="identity")
summary(fit.ide)

fit.log <- cglm(method="ts", formula=hours~nonpov+inschool+spouse+age+mother, 
  data=teenpov, id="ID", link="log")
summary(fit.log)

fit.cglm <- cglm(method="cml", formula=hours~nonpov+inschool+spouse+age+mother,
  data=teenpov, id="ID")
summary(fit.cglm)

Prints summary of instrumental variable estimation

Description

This is a print method for class "summary.cglm".

Usage

## S3 method for class 'summary.cglm'
print(x, digits=max(3L, getOption("digits")-3L), 
  signif.stars=getOption("show.signif.stars"), ...)

Arguments

x

an object of class "summary.cglm".

digits

the number of significant digits to use.

signif.stars

logical. If TRUE, "significance stars" are printed for each coefficient.

...

not used.

Author(s)

Arvid Sjolander

Examples

##See documentation for cglm.

Summarizes instrumental variable estimation

Description

This is a summary method for class "cglm".

Usage

## S3 method for class 'cglm'
summary(object, ...)

Arguments

object

an object of class "cglm".

...

not used.

Author(s)

Arvid Sjolander

Examples

##See documentation for cglm.

Data from the National Longitudinal Survey of Youth (NLSY).

Description

This dataset is a subset of a dataset described by Allison (2009). The original data by Allison (2009) comes from the National Longitudinal Survey of Youth (NLSY), and contains information on 1151 teenage girls who were interviewed annually for five years, starting in 1979. The teenpov dataset is constructed by first identifying, for each girl, the first interview at which the girl is not in poverty, then excluding all subsequent interviews for that girl. After this exclusion, the dataset contains 1342 interviews from 401 girls. This procedure is described in greater detail by Sjolander (2017).

Usage

data(teenpov)

Format

The dataset contains the following variables:

ID

a unique subject-identifier.

nonpov

1 if the girl is currenlty not in poverty according to U.S. federal standards.

hours

the number of hours that the girl currently works per week.

inschool

1 if the girl is currently enrolled in school, 0 otherwise.

spouse

1 if the girl is currently living with a spouse, 0 otherwise.

age

the girl's current age.

mother

1 if the girl currently has at least 1 child, 0 otherwise.

References

Allison P. (2009). Fixed effects regression models: quantitative applications in the Social sciences. Thousand Oaks, CA: Sage.

Sjolander A. (2017). The case-time-control method for non-binary exposures. Sociological Methodology 47(1), 182-211.