33 votes

What percentage of a population needs a test in order to estimate prevalence of a disease? Say, COVID-19

1) Making some assumptions about the population size (namely that it is large enough that a binomial model is appropriate), the prevalence of a disease in a population at a particular time can be ...
Demetri Pananos's user avatar
26 votes
Accepted

How exactly does a "random effects model" in econometrics relate to mixed models outside of econometrics?

Summary: the "random-effects model" in econometrics and a "random intercept mixed model" are indeed the same models, but they are estimated in different ways. The econometrics way is to use FGLS, and ...
Randel's user avatar
  • 6,721
23 votes

How exactly does a "random effects model" in econometrics relate to mixed models outside of econometrics?

This answer doesn't comment on mixed models, but I can explain what the random-effects estimator does and why it screws up on that graph. Summary: the random-effects estimator assumes $E[u_i \mid x ] ...
Matthew Gunn's user avatar
  • 22.4k
21 votes

How exactly does a "random effects model" in econometrics relate to mixed models outside of econometrics?

In this answer, I would like to elaborate a little on Matthew's +1 answer regarding the GLS perspective on what the econometrics literature calls the random effects estimator. GLS perspective ...
Christoph Hanck's user avatar
20 votes
Accepted

Difference between one-way and two-way fixed effects, and their estimation

The unobserved effects model is modeled as: \begin{equation} y = X\beta + u \end{equation} where \begin{equation} u = c_{i} + \lambda_{t} + v_{it} \end{equation} A one-way error model assumes $\...
José Bayoán Santiago Calderón's user avatar
17 votes
Accepted

Difference-in-differences with individual level panel data

A nice feature of difference-in-differences (DiD) is actually that you don't need panel data for it. Given that the treatment happens at some sort of level of aggregation (in your case cities), you ...
Andy's user avatar
  • 19.1k
16 votes
Accepted

Panel data diff-in-diff and the pattern of the binary treatment indicator

I will assume you have a thorough grasp of the two group/two period difference-in-differences (DD) design and you now want to extend your intuition of the method to the multi-group/multi-period case. ...
Thomas Bilach's user avatar
13 votes

What percentage of a population needs a test in order to estimate prevalence of a disease? Say, COVID-19

It has been answered by Dimitri Pananos, I will only add that in order to estimate the prevalence with pre-set precision you need an absolute sample size which is pretty much invariant with the ...
F. Tusell's user avatar
  • 8,608
12 votes
Accepted

Restricted Maximum Likelihood (REML) Estimate of Variance Component

NB. I simplify notation somewhat and do not use bold typesetting. The following rules for matrix differentials are useful: \begin{align} d\log \vert A\vert &= \mathrm{tr}(A^{-1}dA) \\ dA^{-1} &...
KOE's user avatar
  • 4,541
11 votes

How exactly does a "random effects model" in econometrics relate to mixed models outside of econometrics?

I am not really familiar enough with R to comment on your code, but the simple random intercept mixed model should be identical to the RE MLE estimator, and very close to the RE GLS estimator, except ...
dimitriy's user avatar
  • 35.5k
11 votes
Accepted

How to conduct a multilevel model/regression for panel data in Python?

Linear regression will not be suitable for a multilevel model. A mixed effects model is a good way to fit most multilevel models. In python you can use mixedlm in <...
Robert Long's user avatar
  • 60.9k
11 votes

Does it make sense to interact two uncorrelated independent variables in linear regression?

Definitely! ...
Dave's user avatar
  • 62.5k
11 votes

longitudinal data with unequal samples and end points

A few points: Random effects provide a flexible framework for modeling serial correlations. This is achieved by specifying nonlinear functions of time in the random-effects part of the model. An ...
Dimitris Rizopoulos's user avatar
10 votes
Accepted

Difference in difference with interaction

A triple difference-in-difference is the correct specification for this problem. I'll present a conceptual explanation and then a mathematical one. Conceptually, the standard (double) difference-in-...
Heisenberg's user avatar
  • 4,600
10 votes
Accepted

Difference of 'dynamic panel (Nickell) bias' and the 'incidental parameter problem' in panel data?

They deal with estimating different parameters but indeed share common features: Nickell (Econometrica 1981) bias: The time demeaning operation of fixed effects in a dynamic panel data model $$ y_{...
Christoph Hanck's user avatar
10 votes

How exactly does a "random effects model" in econometrics relate to mixed models outside of econometrics?

Let me confuse things even more: ECONOMETRICS - FIXED EFFECTS APPROACH The "fixed effects" approach in econometrics for panel data, is a way to estimate the slope coefficients (the betas), by "by-...
Alecos Papadopoulos's user avatar
10 votes

Difference between Multivariate Time Series data and Panel Data

In short, there is no such thing as Multivariate Time Series data. The only classic data types out there are: Cross Sections, Time Series, Pooled Cross Sections, and Panel data. Panel data is ...
ColorStatistics's user avatar
10 votes

Time varying covariates in longitudinal mixed effect models

Dealing with time-varying covariates in mixed models but also in general is a challenging task. A few points to consider: I would differentiate between time-varying covariates, such as smoking, and ...
Dimitris Rizopoulos's user avatar
9 votes
Accepted

Effects in panel models "individual", "time" or "twoways"

The canonical two-way model is $$ y_{it}=x_{it}'\beta+\alpha_i+\theta_t+\epsilon_{it} $$ Here, the individual effect is $\alpha_i$, and $\theta_t$ is the time effect. It is a two-way model if both are ...
Christoph Hanck's user avatar
9 votes
Accepted

Panel Data: Pooled OLS vs. RE vs. FE Effects

First, you are right, Pooled OLS estimation is simply an OLS technique run on Panel data. Second, know that to check how much your data are poolable, you can use the Breusch-Pagan Lagrange multiplier ...
keepAlive's user avatar
  • 1,019
9 votes

Any way to test if the association between X and Y could be causal, reverse-causal or non-causal (just correlation)?

As has been discusssed extensively, evidence for causation does not come from data. It comes from understanding the data generating process, the meaning of the measurements, the subject matter ...
Frank Harrell's user avatar
9 votes
Accepted

Any way to test if the association between X and Y could be causal, reverse-causal or non-causal (just correlation)?

To argue that this relationship is causal, you need an exogenous shock which only affects X and does not directly affect Y. Moreover, the shock should not affect other factors related to Y, otherwise ...
Dudelstein's user avatar
9 votes

longitudinal data with unequal samples and end points

I believe that you are fine to use the approach you outlined in your question. There is more between id variance at time==0 (the random intercept) than there is in the rate of change (random slope for ...
Erik Ruzek's user avatar
  • 4,715
9 votes

longitudinal data with unequal samples and end points

I have found that for data similar to yours the fit of the model to the actual correlation patterns is crucial. For example if you use random effects and the induced correlation pattern is not what ...
Frank Harrell's user avatar
8 votes
Accepted

Panel vector autoregression models in R?

There is your solution. Code will be available soon. https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2896087 Panel Vector Autoregression in R: The Panelvar Package: This paper considers two ...
Michael Sigmund's user avatar
8 votes
Accepted

Demeaning with two (n) fixed effects in panel regressions

If you use demean approach (which is theoretically right), then you have to do demean your data both cross sectionally and time series (irrespective of the order). See how it is works. Assume ...
Neeraj's user avatar
  • 2,320
7 votes

How to determine the appropriate number of lags when using Newey-West (or HAC) standard errors

My answer is going to expand on what @Achim mentioned as "the growth rate of this lag length parameter". Newey & West (1987, Econometrica, p. 705) show that their estimator for the ...
Candamir's user avatar
  • 1,030
7 votes

PSM on panel data , R-square is low at (first stage) logit regression

The reason to use propensity scores is to create balanced groups on your set of covariates. Your R-square, the plausibility of your selection model, and any other considerations about the propensity ...
Noah's user avatar
  • 33.5k
7 votes
Accepted

What is cross-lagged panel design?

The cross-lagged panel model (CLPM) is a type of structural equation model (specifically a path analysis model) that is used where two or more variables are measured at two or more occasions and ...
Robert Long's user avatar
  • 60.9k
7 votes
Accepted

Dynamic treatment timing in a panel-DiD framework

You construct the policy dummy the way you first describe it, i.e. create a column of zeroes. Then for each firm you replace this with ones if a firm is in the treatment group AND it is in the post-...
Andy's user avatar
  • 19.1k

Only top scored, non community-wiki answers of a minimum length are eligible