-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
69 lines (51 loc) · 1.75 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = F}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
# devtools::install_github("Hemken/Statamarkdown")
library(Statamarkdown)
```
# summclust
Stata module for cluster level measures of leverage, influence, and a cluster jackknife variance estimator.
For a very detailed description see:
MacKinnon, J.G., Nielsen, M.Ø., Webb, M.D., 2022. [Leverage, influence,
and the Jackknife in Clustered Regression Models: Reliable Inference
Using Summclust](https://arxiv.org/abs/2205.03288). Stata Journal (accepted).
### nlswork example - using regress
```{stata}
webuse nlswork, clear
keep if inrange(age,20,40)
reg ln_wage i.grade i.age i.birth_yr union race msp, cluster(ind)
```
### nlswork - using summclust
```{stata, echo=-1}
webuse nlswork, clear
keep if inrange(age,20,40)
summclust ln_wage msp union race, fevar(grade age birth_yr) cluster(ind)
```
### adding industry fixed effects using absorb
```{stata, echo=-1}
webuse nlswork, clear
keep if inrange(age,20,40)
summclust ln_wage msp union race, fevar(grade age birth_yr) absorb(ind) cluster(ind) nog
```
### Effective Number of Clusters using gstar or rho.
```{stata, echo=-1}
webuse nlswork, clear
keep if inrange(age,20,40)
summclust ln_wage msp union race, fevar(grade age birth_yr) cluster(ind) nog gstar
summclust ln_wage msp union race, fevar(grade age birth_yr) cluster(ind) nog rho(0.5)
```
### All Output
```{stata, echo=-1}
webuse nlswork, clear
keep if inrange(age,20,40)
summclust ln_wage msp union race, fevar(grade age birth_yr) cluster(ind) regtable rho(0.5) addmeans table
```