# Questions tagged [stata]

A statistical software package. Use this tag for any on-topic question that (a) involves Stata either as a critical part of the question or expected answer, & (b) is not just about how to use Stata.

554 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6k views

I’m using Stata 12.0, and I’ve downloaded the polychoricpca command written by Stas Kolenikov, which I wanted to use with data that includes a mix of categorical ...
1k views

### Marginal means vs. marginal effects. What is the difference?

In R, there are two packages: emmeans and margins. The first implements the LS-means known from SAS, here called estimated marginal means, the second implements the margins command from Stata. I ...
• 185
4k views

### Confidence interval for the restricted mean in survival analysis

What is the recommended way of calculating confidence intervals for the restricted mean in survival analysis? Here are some example data, taken from the paper Chris Barker (2009), The Mean, Median, ...
• 5,442
511 views

### How do I interpret the random intercepts of a multilevel mixed-effects model?

I am using a three-level mixed-effects model in which: individuals (level 1) are nested in primary sampling units (PSUs) or enumeration areas (level 2) which in turn are nested in countries (...
• 51
8k views

### Principal Component Analysis on Time series data and panel data

I am trying to build an index on infrastructure and compare the index over the years and between nations. Since the variables are highly correlated with each other, review has suggested me to proceed ...
• 501
1k views

### Must data be time-series to contain structural breaks?

I have a simple linear regression model and am trying to locate structural breaks in the relationship between the two variables. The data are cross-sectional, not time-series. I've been using Wald ...
533 views

### Generalised Residuals - Estimated value of the density at that point for observation $j$ $i$?

I am trying to write R code for the generalised residuals as described in Vella (1993) and also mentioned by Wooldridge (2014). Wooldridge suggests to use these ...
• 379
454 views

### bias adjusted confidence interval for correlation coefficient

I stumbled across confidence intervals for $\rho$ in a statistics textbook. This was not part of the class, but I found it interesting. My textbook has a formula for this with a Fisher transformation, ...
• 73
2k views

### Interpretation of R-squared when using FGLS

Context: I am analyzing time series and cross-sectional data using Stata's xtpcse command which corrects for autocorrelation in panel data using a Prais–Winsten ...
• 41
921 views

### Correcting for heteroscedasticity in logistic regression

I am using a large health dataset as a part of a research project (N = ~18 000). My colleagues and I are investigating whether smoking predicts the presence or absence of a mental illness. We are ...
3k views

### Income and price elasticity for multinomial logit/probit and alternative-specific conditional logit/multinomial probit in Stata?

I have a question about estimating income/price elasticity of demand for multinomial logit/probit models in Stata. Lets say I fit a discrete choice model where the outcome is product chosen (4 ...
• 1,755
1k views

### SARIMA, coefficients check

I would appreciate if someone could check the mathematical equation for the seasonal ARIMA (4,1,4) x (1,1,1) period 12 that I wrote. I have done it this way, but I am not really sure if it correct is. ...
• 167
2k views

### Adjusted / marginal means estimation in linear mixed effect model in R / Stata

I am a new R user, having some difficulties validating/replicating results from Stata (which a colleague uses) in R. We are investigating the time (TIME<-c(1:7))...
• 41
7k views

### Collinearity diagnostics disagree - VIF, condition index, and correlation matrix

I'm working with a large dataset consisting of just over 1 million cases. The data are longitudinal covering 14 years and hierarchical with about 500 of the level 2 units. Each case is a criminal ...
• 538
37 views

### Reverse Causality with Additional Period

I have been struggling for a model to estimate related to sequential treatment effect and need a help desperately. I would greatly appreciate it if you guide me to the resources or advice me on this ...
456 views

### How to bootstrap samples from data that has more than dependent variable?

I understand bootstrap sampling with replacement. But what i still not sure about is that how to apply this approach to sample from data that has more than one dependent variables. For example, ...
• 131
807 views

### Is it possible to make an in-sample dynamic forecast / prediction for an ARIMA model?

We are trying to check to what extent the changing X-values might explain the observed trend in Y. By "in-sample" I mean: using the same data as was used for the model building. By "dynamic" I ...
• 31
569 views

### Diff-in-diff: Individual outcomes and group-level treatment

Question: What are my best options for handling group-level correlations in a panel differences-in-differences model using StataSE 14.2? Background: I have a Differences-in-Differences (DiD) design ...
89 views

### Which duration model to use with a fully right censored database

Currently I'm examining the duration of residence of households. I have a database at my disposal that indicates how long a specific household resides in its current home. I want to explain their ...
• 31
4k views

### cluster robust standard error in R after glm

my regression is the following glm_test <- glm(formula=FormulaWritten,data=Regress_Sample,na.action=na.exclude,family=binomial(probit)) I want to compute ...
• 247
310 views

### SUR with unbalanced panel and cross equation restrictions - available software?

I would like to estimate a SUR model with an unbalanced panel and with cross equation restrictions. This does not seem possible with the standard SUR commands in Stata or R. Do you have an idea which ...
• 211
371 views

### Evaluating the magnitude of AIC and BIC reductions

Reading the interesting post Interpretation of variance in multilevel logistic regression I understood that I cannot compare multilevel logistic models looking at the empty model and at variance ...
• 945
77 views

### Estimating Equations for Treatment Model in Treatment Effects Estimation — How is this Equation Derived?

While reading the STATA 14 Treatment Effects Reference Manual (http://www.stata.com/manuals14/te.pdf), I'm having difficulty understanding how they arrive at the equation for the treatment model, that ...
• 359
82 views

### How to deal with treatment effects that occurs multiple times at different time for each individual ID

I've been searching for a long time for this issue and couldn't find the proper answer so I post a question here. Here I put the data set example first. ...
1k views

### How to Test for Some Basic Assumptions of (Zero Inflated) Negative Binomial?

I am currently working with a T dominant panel --time-series cross-section dataset-- that has N = 8 (eight European countries) and T = 28 (28 quarters for each country). The dependent variable --...
• 141
3k views

### Plogit: Lasso logistic regression with Stata

I want to execute a Lasso logistic regression with Stata. Why? Because... 1.) I have a dummy dependant variable (=> Investment success (1) and failure (0)); samples(1/0)(28/23). 2.) I have a set of ...
• 303
916 views

### Multilevel models comparison and diagnostics in Stata

I'm working with three level models in Stata using mixed command. Taking reproducible example from the manual: ...
• 1,377
363 views

### What is difference between Quantile function and standard normal quantile or probit function?

I'm reading about rank based inverse normal transformation. Basically it's applied to ranked random variable and transform it to normal distribution. I have problem in understanding the transformation ...
• 2,653
473 views

### heteroskedasticity in logit/cox

I am using a logit and a cox proportional hazard model for my analysis, and the newest version of Stata. I have found that there are no tests to check for heteroskedasticity for logit/probit models, ...
• 31
421 views

### Replicating stata results in R

I'm working with a faculty member who wanted me to do the data work in Stata, but now wants me to estimate the models in R as well because the graphics are more flexible. However, I'm having some ...
591 views

### Current Population Survey (CPS) Data in Bertrand/Duflo/Mullainathan

I am trying to replicate the results in Bertrand, M., Duflo, E., Mullainathan, S., 2004. How Much Should We Trust Differences-In-Differences Estimates? The Quarterly Journal of Economics 119 (1). 249–...
327 views

### Standard error computation with interaction term

I aimed at studying the effects of an exposure (E) on fetal growth estimated by repeated ultrasound measurements (n = 2 measures per participant in the following example). I used interaction terms of ...
2k views

### Marginal effect clogit not significant

I developed a conditional logit model in Stata. The model is good and the variables are highly significant. Then I do mfx predicted (PU0) to determine the marginal effects of variables $\frac{dy}{dx}$....
• 31
557 views

### Relaxing the parallel lines assumption in a proportional odds model

I tried to specify a partial proportional odds regression in STATA using the gologit2 command. However, gologit2 runs ...
• 1,208
3k views

### Confidence Interval for a Percent Change

A mentor has asked me to calculate the 95% confidence interval surrounding a percent change. To help frame the question, I have calculated the incidence of a disease within the population as follows: ...
• 43
246 views

### Combination of multinomial logit model and logit model

I want to analyze the determinants of credit constraints of a firm. I have information for both formal and informal credit. I have 6 categories of credit-constraint statuses of a firm for formal ...
• 31
6k views

### What to do when ovtest and linktest in Stata suggest model misspecification?

I have a sample that consists of 50 observations. The base model of the OLS-Regression with three control variables, two of them significant, has a $R^2=0.50$ and its F-Value is 7. Both ...
• 31
924 views

### Using Poisson instead of transforming the data

I note with interest an article which has been suggested to me over here: http://blog.stata.com/tag/poisson-regression/ I have the problems outlined in this blog - namely zeros (in the independent ...
27 views

### How can I possibly test b_4<b_3<b_2<b_1<0 in stata?

I am trying to run a test on coefficients relationship after linear regression. How can i test the following relationship: b_4<b_3<b_2<b_1<0 Thank you!
66 views

### Hurdle model for non-count continuous data with both positive and negative values

I am aiming to estimate a hurdle model (where being non-zero is the hurdle) in the vein of Cragg. My data is both positive and negative where the data reflects the difference between a value reported ...
• 21
188 views

### What are the assumptions of fractional response regression model?

I employed fractional response regression proposed by Wooldridge and Papke for my study as the dependent variable is a proportion (remaining/whole) and is between 0 to 1 (including 0 and 1). I want to ...
• 205
21 views

### Which test to use for associations between categorical independent and ordinal outcome

I am analyzing factors that influence program retention in a medical program. Our dependent variable, retention time, is split into 4 categories (<1 month, 1-3 months, 3.1-6 months and >6 months)...
• 21
41 views

### R-squared: Panel Data Regression

I have a question about $R^2$ is panel data regression. Let's suppose that I estimate the following model by random effects: $$y_{it} = \alpha + \beta x+u_i+\epsilon_{it}$$ Then, by assumption, ...
1k views

### Adding Controls to Staggered Difference in Difference Regressions on Stata

I am running a staggered diff-in-diff model, looking at legalization's effect on various variables. For context, only a percentage of all states have legalized, and the year they legalized differs ...
242 views

### How do I properly run a propensity correction for a fixed-effects model in Stata?

I have a fixed effects regression with a highly unbalanced panel. I am recording the outcome for each day a person participates over the course of a fifteen year time frame. Individuals can enter or ...
• 21
1k views

### STATA margins dydx with over(.), continuous variables and interaction effect

I have a logistic regression model with two variables (A and B), which I also interact. A and B are both continuous. After the estimation I want to use the margins command to plot the marginal effect ...
307 views

### Stata: testing for serial correlation in residuals of fixed effects model (xtqptest on reghdfe)

I want to test for first order serial correlation in the residuals of this Stata regression model: ...
• 203
338 views

### Including a variable in the outcome equation only with Heckman probit

In Stata, we are using heckprobit to address an endogeneity concern we have in our model. The model and the instrument used on the selection equation look great and ...
• 21
I have a problem that deals with human capital. I assume that wages $W_{it}$ are determined by the level of human capital $K_{it}$ and the market clearing rental rate that applies to all workers \$R_{t}...