Hot answers tagged

15 votes

R in econ departments?

In my university the choice of program is considered generally irrelevant. We focus on results, and it is up to each student to determine which program is best suited for the task and user preference. ...
12 votes
Accepted

Outputting Regressions as Table in Python (similar to outreg in stata)?

You can use code like the following (making use of the as_latex function) to output a regression result to a tex file but it doesn't stack them neatly in tabular form the way that outreg2 does: ...
  • 16.1k
8 votes

R in econ departments?

If you are only looking for "A department where at least few researchers use R? ", I believe you should be able to find plenty. In my department (Vanderbilt University), I can count at least ...
7 votes
Accepted

Papers that use R vs Stata

The main economic journals are slowly starting to require authors to make their data and the code of their analysis available as part of the online appendix. When this is the case, it is easy to ...
7 votes

R in econ departments?

Basically it's better to use the software your PI uses! First (s)he will be able to correct your code. Second, if you're a TA for a class using one software, it's better to handle it... To find the ...
  • 698
7 votes

Outputting Regressions as Table in Python (similar to outreg in stata)?

You can use the stargazer package (install with pip install stargazer). From https://github.com/mwburke/stargazer/blob/master/...
7 votes

Python vs R (vs Stata): the old battle revisited

I use all three programs. Python can do everything that R can do and R can do everything that Python does, but I must say R is superior to Python when it comes to the packages. For that reason for ...
  • 48.7k
6 votes
Accepted

What are the main differences among xtreg, areg, reghdfe?

xtreg xtreg is a general command for panel regression. The panel regressions will have the following general form (see stata manual): $$y_{it} = α + \mathbf{x_{it}β}...
  • 48.7k
6 votes
Accepted

Will excluding the intercept affect other variables' coefficients?

Running an (OLS) regression with or without intercept will not change the other coefficients of the other covariates if the means of (all) these covariates are zero. For simplicity, consider the case ...
  • 8,662
5 votes

Outputting Regressions as Table in Python (similar to outreg in stata)?

There is now a Python version of the well known stargazer R package, which does exactly this. See also this related question: https://stackoverflow.com/q/35051673/2858145
5 votes

Papers that use R vs Stata

See RePEc's software top. You'll find much Stata, a bit Matlab, and nothing else. From long personal observations, economists' preferences are ranked like this: Stata (none) Matlab Python, R SAS, ...
5 votes

Robust Standard Errors in Fixed Effects Model (using Stata)

Use -areg- in Stata, and the standard errors will come out as in the textbook. Specifically, the command ...
5 votes

How to average CDFs of one variable across years

Why don't you just take a weighted average? Suppose you have ten years $t \in \{1,...,10\}$ and year $t$ has $N_t$ observations such that in total you have $\sum_t N_t=N$ observations. Let the year-$t$...
  • 5,120
4 votes

Robust Standard Errors in Fixed Effects Model (using Stata)

I'm still not sure if I'm doing something wrong. However, it is useful to note that I get the same results in R. ...
  • 9,285
4 votes
Accepted

Regression with weights

If you check Stata's help file on regress you should understand how to do it. Particularly pp. 16-7 have specific examples of how to apply weights. I will edit in order to be more detailed. ...
4 votes

How to average CDFs of one variable across years

The answer by @Baysiean proposed to compute a weighted average of the per-period empirical distribution functions $EDF_t(w)$ (where $w$ is the value in the support of a random variable $W$), a value ...
4 votes
Accepted

What does chi p(q) mean?

This is most likely a $\chi^2$ distribution with a degree of freedom of 3. From Wikipedia: In probability theory and statistics, the chi-squared distribution [...] with k degrees of freedom is the ...
  • 27.7k
3 votes

Robust Standard Errors in Fixed Effects Model (using Stata)

To understand the issue let's review what is the so call robust variance-covariance matrix estimates (VCE) and the implied "robust" standard errors. The robustness is meant to allow for violations of ...
3 votes
Accepted

Linear Probability Model Instead of Logit in Fixed Effects Regression

FE logit requires the idiosyncratic errors to be IID across $i$ and $t$, quite a strong assumption. Also the regressors should be strictly exogenous, but it's the same for linear FE models. In your ...
  • 2,094
3 votes

What are the confidence interval alpha in regression? Why 0.1 is looser than 0.01?

Confidence intervals (CI) exist within the `frequentist' tradition of statistics/econometrics. In the very loosest sense, frequentism takes the perspective that there is some true parameter out there. ...
  • 564
3 votes
Accepted

What is the "prediction model" in Dasgupta (2019)?

I am not familiar with this specific text, however, I've been asked to elucidate and will do so as an answer, though I do not utilize these techniques often, so there are undoubtedly important ...
2 votes

Why does adding a quadratic term to a regression change unrelated coefficients?

Your errors aren't the same anymore. For example, instead of writing $Y = \beta_1 + \beta_2 X + U$, you're actually writing $Y = \alpha_1 + \alpha_2 X + \alpha_3 X^2 + V$. There is no expectation ...
  • 395
2 votes
Accepted

Two-way clustering in Stata

Have you seen http://faculty.econ.ucdavis.edu/faculty/dlmiller/statafiles/ ? I see some entries there such as Multi-way clustering with OLS and Code for “Robust inference with Multi-way Clustering”. ...
  • 2,094
2 votes

Econometrics: Omitting a significant variable

It is important to recognize that there are path dependencies to removing different variables from your model. This is due to the fact that variables can be highly correlated (positively or negatively)...
  • 426
2 votes

Econometrics: Omitting a significant variable

You should do none of the above. This is an invalid decision-making process. In the best of all possible worlds, create a series of do loops and go through the set of all possible combinations of ...
  • 2,006
2 votes

Testing for heteroskedasticity in panel data vs time series?

You can regress residual squares (from RE or FE depending on your estimation) on $X_{it} \hat\beta$ and its square using the clustered standard errors (the ...
  • 2,094
2 votes
Accepted

Coefficient omitted because of collinearity

You have firm fixed effects. Presumably, every firm is in the same country throughout your observation period. Moreover, no country ever changes its development status (I assume). Hence, for a given ...
  • 1,272
2 votes

How to interpret fixed effect regression R-sq. results for panel data?

In panel regressions you have multiple dimensions and that is why also you have 3 different $R^2$. The within $R^2$ tells you how much variation within your panel variables is on average explained by ...
  • 48.7k
2 votes

Python vs R (vs Stata): the old battle revisited

I use Stata and Python heavily. I have dabbled in R, but won't pretend I know it well enough to comment on it. Stata and Python complement each other nicely and I am a big fan of both. You can run ...
2 votes
Accepted

Should I include country dummies when I combine datasets of 3 countries?

I would advise you to think deeper about your research question first, as this will guide the decision to use country fixed effects. If you would like to exploit cross country variation, for example ...

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