pglm: Panel Estimators for Generalized Linear Models

View source: R/pglm.R

pglmR Documentation

Panel Estimators for Generalized Linear Models

Description

Estimation by maximum likelihood of glm (binomial and Poisson) and 'glm-like' models (Negbin and ordered) on longitudinal data

Usage

pglm(
  formula,
  data,
  subset,
  na.action,
  effect = c("individual", "time", "twoways"),
  model = c("random", "pooling", "within", "between"),
  family,
  other = NULL,
  index = NULL,
  start = NULL,
  R = 20,
  method = c("bfgs", "newton"),
  trace = 0,
  ...
)

ordinal(link = c("probit", "logit"))

negbin(link = c("log"), vlink = c("nb1", "nb2"))

Arguments

formula

a symbolic description of the model to be estimated,

data

the data: a pdata.frame object or an ordinary data.frame,

subset

an optional vector specifying a subset of observations,

na.action

a function which indicates what should happen when the data contains NAs,

effect

the effects introduced in the model, one of "individual", "time" or "twoways",

model

one of "pooling", "within", "between", "random",

family

the distribution to be used,

other

for developper's use only,

index

the index,

start

a vector of starting values,

R

the number of function evaluation for the gaussian quadrature method used,

method

the optimization method, one of "bfgs" (the default) and "newton"

trace

an integer

...

further arguments.

link, vlink

arguments of family functions

Value

An object of class "miscr", a list with elements:

Author(s)

Yves Croissant

Examples

## a binomial (probit) example
anb <- pglm(union ~ wage + exper + rural, union_wage, family = binomial('probit'),
            model = "pooling",  method = "bfgs", trace = 3, R = 5)

## a gaussian example on unbalanced panel data
ra <- pglm(mv ~ crim + zn + indus + nox + age + rm, hedonic, family = gaussian,
           model = "random", trace = 3, method = "newton", index = "townid")

## some count data models
la <- pglm(patents ~ lag(log(rd), 0:5) + scisect + log(capital72) + factor(year), patents_rd,
           family = negbin, model = "within", trace = 3, method = "newton",
           index = c('cusip', 'year'))
la <- pglm(patents ~ lag(log(rd), 0:5) + scisect + log(capital72) + factor(year), patents_rd,
           family = poisson, model = "pooling", index = c("cusip", "year"),
           tracen = 0, method="newton")


ycroissant/pglm documentation built on Dec. 8, 2023, 4:54 a.m.