4
1 [email protected] Master Economics and Public Policy Ecole Polytechnique – ENSAE - Sciences Po Academic year 2009-2010 Quantitative sociology Basics on GLM on stata 11

1 [email protected] Master Economics and Public Policy Ecole Polytechnique – ENSAE - Sciences Po Academic year 2009-2010 Quantitative sociology

Embed Size (px)

Citation preview

Page 1: 1 louis.chauvel@sciences-po.fr Master Economics and Public Policy Ecole Polytechnique – ENSAE - Sciences Po Academic year 2009-2010 Quantitative sociology

1

[email protected]

Master Economics and Public PolicyEcole Polytechnique – ENSAE - Sciences Po

Academic year 2009-2010

Quantitative sociology

Basics on GLM on stata 11

Page 2: 1 louis.chauvel@sciences-po.fr Master Economics and Public Policy Ecole Polytechnique – ENSAE - Sciences Po Academic year 2009-2010 Quantitative sociology

2

What do we do today?

Overview on General Linar Model What’s this? =>

generalization of many kinds of regressions

Syntax =>glm vardep listofvarindep [fweight=weightvar] if (condition), family(xxx) link(yyy)

comparison of models, etc. => estimates store mod / estimates stats mod for the bics

On STATA 11: same as regression and logit : for categorical indep var and for interactions

Page 3: 1 louis.chauvel@sciences-po.fr Master Economics and Public Policy Ecole Polytechnique – ENSAE - Sciences Po Academic year 2009-2010 Quantitative sociology

3

Categorical independent variablesno more “ xi: ”

To change the reference category = fvset base 2 gender

Expression of interactions “ # ” for interaction without fist order variables

“ ## ” for interaction AND fist order variables

Page 4: 1 louis.chauvel@sciences-po.fr Master Economics and Public Policy Ecole Polytechnique – ENSAE - Sciences Po Academic year 2009-2010 Quantitative sociology

4

| id log logit probit clog pow opower nbinomial loglog logc

----------+-------------------------------------------------------------------

Gaussian | x x x

inv. Gau. | x x x

binomial | x x x x x x x x x

Poisson | x x x

neg. bin. | x x x x

gamma | x x x

link()family()

Family glm option

----------------------------------------

Gaussian(normal) family(gaussian)

inverse Gaussian family(igaussian)

Bernoulli/binomial family(binomial)

Poisson family(poisson)

negative binomial family(nbinomial)

gamma family(gamma)

Link function glm option

----------------------------------------

identity link(identity)

log link(log)

logit link(logit)

probit link(probit)

complementary log-log link(cloglog)

odds power link(opower #)

power link(power #)

negative binomial link(nbinomial)

log-log link(loglog)

log-complement link(logc)