# 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.

1,339 questions
Filter by
Sorted by
Tagged with
0answers
10 views

### Propensity Score Matching for Panel Data with Multinomial Outcome on Stata

I have a panel data set from 1999-2019 through which I would like to find whether a divorce would change a respondent's political opinion. I have identified a number of covariates, most of which are ...
0answers
10 views

### Random-intercept model with three levels: heteroschedasticity of level-1 and non-normality of level-2 residuals?

I am working on a random-intercept model with three levels and I have questions regarding the distribution of the residuals and its effect on coefficients and confidence intervals. But first let me ...
0answers
3 views

### How to add robust error variances in glm Poisson model in R?

I am running two parallel analyses for log poisson regression in R and State. In Stata, there is an option of specifying "robust" within the code, but within the R code: ...
0answers
8 views

### Using IV with Diff-in-Diff Model in Stata

For my data analysis, I am estimating a difference-in-difference model of the sort: Y = a + bPOST + cTREAT + dPOST##TREAT +eCONTROLS + u Since I am concerned with ...
0answers
11 views

### How to solve this problem with monthly data [closed]

How to use this function by using the monthly data. what format should be?
0answers
11 views

### Null hypothesis testing in Stata [closed]

I have an estimated regression line that looks something like this (where a*b is the interaction term) Y=B+B1*a+B2*b+B3*a*b I want to find the p-value for a test ...
0answers
17 views

### Interaction effects in non-linear models with Mlogit [closed]

In the case of mlogit, the command margins, over(race father_occ) expression(exp(xb())) post How can we specify outcome(1) and calculate for each of the outcome categories; Or any other way to ...
0answers
37 views
+50

### How flexible is Stata's ivpois? Could I use it for a (quasi) binomial distribution?

According to this post on statalist, Stata's ivpois (an instrumental variable approach) is pretty flexible, with very little assumptions. The problem mentioned in ...
0answers
21 views

### how to compute marginal effects of predictors in NBSTRAT (truncated & endogenously stratified negative binomial) model? (Stata)

I'm using STATA 16.0 to develop recreational demand function via using NBSTRAT model. I have several factor and continuous variables that force me to use "xi:" prefix in the model syntax ...
2answers
16 views

### Getting the (Stata) margins from fractional regression (=glm with family quasibinomial) for an ordinal variable in R

I first found this really nice Stata video on fractional regression (the dependent variable is a proportion including 0 and 1). I am especially interested in how he applies the margin approach to ...
0answers
10 views

### Multilevel logistic regression: is it possible to apply

We conducted a study and the results submitted to a journal and one of the reviewers suggested me to conduct a hierarchical logistic regression. Basically I know how to conduct multilevel regression ...
1answer
41 views

### fmm, lcprob(m): regress y x

I am wondering if someone would help me to understand the the stata command posted here: https://www.stata.com/stata-news/news32-4/spotlight-fmm/ the article explains that the command fmm 2, lcprob(...
1answer
17 views

### How to use gsem when the independent variables are binary?

According to this website, "Binary—probit, logit, complementary log-log". But does the "binary" here mean independent variable or the latent variable (that is determined by the ...
0answers
6 views

### Create a variable from Stata local [migrated]

I want to know how to create a variable that stores the value of a macro. The most simple example would be something along the lines of storing the value of i' in a ...
0answers
7 views

### Comparing the change in technical coefficients of one sector that received FDI is significantly different compared to change in others that did not

I have datapoints which are technical coefficients (from input output tables) of 10 sectors for 5 years. Some of these have received FDI. I want to check whether the change in the technical ...
0answers
9 views

### How to analyze dataset for an ecological study? [duplicate]

My independent variable is health care system (continuous and non normally distributed) and dependent variable are health outcomes(continuous) . This data is available for 40 cities. How should I ...
0answers
7 views

### Implementing a structural equation model in a within-between hybrid model

I am working on longitudinal data with three waves and have first utilized a hybrid probit regression model (within-between regression model). I have run the analyses in STATA using the following code:...
0answers
18 views

### Sample size calculation for comparison of 3 groups

I need to calculate the sample size needed. The outcome variable is binary (0 if no, 1 if yes). I have three groups (e.g., group A, group B, group C). What I know (or assume) is that the proportions ...
0answers
9 views

### How do I interpret xtprobit with random effects?

My probit model has panel data. The dependent variable is a binary outcome that survives = 1 and not survives = 0. I am estimating South Africa's export trade relationships that are importer-product ...
0answers
14 views

### What are the assumptions of conducting a mediation analysis using structural equation modelling

What are the core assumptions when doing mediation analysis in structural equation modelling? I am estimating the classic mediation model using SEM in panel data in Stata with fixed effects (image ...
1answer
39 views

### If all my variables' first difference is stationary, does it mean my variables are all stationary?

I wonder all my variables' first difference is stationary, does it mean my variables are all stationary in time series? What model should I use then? what the format would be? How to address this ...
0answers
15 views

### Diff vs xtreg different results in Stata

I am trying to perform a DiD with three different methods. Here is an example of my dataset (the complete data is here), where "regime" is the treatment that starts in 2007 and goes until ...
0answers
6 views

### GMM sensitivity to model specification and adequacy of the model

I'm analyzing a panel dataframe with T = 17 and 42 groups for a total of about 700 observations. I have performed an ADL analysis and would like to perform a difference GMM analysis as this is ...
0answers
26 views

### How do I interpret the results from xtprobit random effects model with robust standard errors in stata?

My probit model has panel data. The dependent variable is a binary outcome that survives = 1 and not survives = 0. I am estimating South Africa's export trade relationships that are import-product ...
0answers
5 views

### How can get rid of the small sample-adjustment in ivreg in R

I am currently attempting to replicate the results of a Stata Code. The original code uses the stata command: ...
0answers
18 views

### How do I fix the problem of collinearity, i think i am in the dummy variable trap [duplicate]

I am estimating the whether floods affect electoral outcomes and I am using a difference-in-difference estimator. I have run my probit model with reelected party as the dependent variable (1 if ...
0answers
18 views

### GMM regression and instruments count with xtabond2

I have to perform a difference GMM regression on my panel data. It's not important that it works, but if it does not I need robust motivation for why not. My panel data is divided in two bigger groups,...
0answers
18 views

### Replicating STATA output for RR and confidence intervals based on marginal effects in [R]

I am working on replicating an output from STATA, with the following data where we want to obtain Relative risk and confidence intervals based on the marginal effects. I have been able to calculate ...
0answers
21 views

### Goodness of fit for LPM

I want to carry out goodness of fit statistics for a Lineary Probability Model. However, given that R^2 might not be the best choice, I am wondering which other options would be worth looking into?
0answers
14 views

### Modelling Biprobit using the ML command on STATA

thanks in advance for your help. For a research project, I am trying to replicate some built-in MLE commands using the ml stata routine. Specifically, I am trying to replicate the results from the ...
0answers
26 views

### Multilevel Ordered Logistic Regression (meologit)

I have data on individual outcomes where the individual is a member of a subgroup (e.g. department) and a group (e.g. firm). I have analysed this (cross-sectional) data in Stata using an ordered logit ...
0answers
20 views

### Getting standard errors for a counterfactual

I fit a linear model and want to know what the percentage increase in aggregate f(y) of setting regressor x to 0. The point ...
1answer
28 views

### Standard error of a hypothetical predicted value in logistic regression?

I'm not sure how to ask this question to Google, so I'm coming here. Learning (some) stats long ago, I was shown that once you've calculated your regression results and built a new model (in plain ...
0answers
22 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 ...
1answer
56 views

### How to interpret OLS regression with two dummy variables

I am currently working with a regression model that includes two dummy variable (y = divorce 0 = no, 1 = yes | x = households 0 = two-parent, 1 = one-parent) and I am really struggling with the ...
0answers
24 views

### Choosing correct multiple comparison method for proportions

I am examining pairwise differences in proportions. I have 19 groups giving a total of 171 comparisons in a data set with $n \approx 40000$. I am unsure about which multiple comparison adjustment that ...
1answer
75 views

### Alternatives to Cluster Analysis with Very Large Data

My colleague and I have a very large dataset on agricultural data. There are over 20,000 rows and this was collected as a weighted survey. Most of our variables are binary (yes/no) on characteristics (...
0answers
35 views

### Interpretation of the correlation between two categorical variables

I have two dummy variables and calculated the correlation between them using Stata. X = Gender ($1=$ female/ $0=$ male) Y = Quiz ...
1answer
59 views

### Correct way to standardize interaction term with one binary and one continuous variable?

Say that I want to run a regression of Y on 1) a binary main effect (B); 2) a continuous main effect (C); and 3) an interaction of 1 and 2 (BC): gen BC=B*C. If I ...
2answers
17 views

### Rewriting coefficients of a regression

We are interested in the variable $\alpha_1$, in the equation $y_{iv1}=\alpha_0 + \alpha_1group_v+x_ia_x+ \gamma y_{iv0} + \epsilon_{iv1}$ Where $y_{iv1}$ is a dummy variable, and $x_ia_x$ denotes ...
1answer
20 views

### How to interpret hazard ratios in Cox model in Stata?

I am estimating the survival of trade relationships from South Africa to various importing countries. These are the hazard ratios using robust standard errors. I just want to know how to interpret the ...
0answers
11 views

### Calculating relative measures in panel data?

How would I do this in Stata "The relative measure is calculated as the number of standard of deviations the log of total assets of a bank I at time period T deviates from the mean total assets ...
0answers
47 views

### Why is my nonlinear regression returning different coefficients between R and Stata?

I am replicating Stata code in R, but a nonlinear regression is returning very different coefficients between the two programs. Stata's code runs perfectly, but the issue is with my attempt to ...
1answer
21 views

### Bar and line graphs overlaying on same figure, containing groups, and by another group [closed]

I am attempting to create a figure that essentially has a bar graph corresponding to one group and a line graph for another group, but where there are two groups within each of the formerly described ...
0answers
17 views

### Does the exploded data format impose the IIA assumption on models that relax the assumption?

Exploding data is used for choice experiments when more than one choice is made. For example, if there are three options and a respondent is asked to rank those options a conventional dataset may look ...
0answers
7 views

### Multilevel Model Specification with duplicated rows

I have a dataset that has 360 households from 60 villages (cluster variable). I have a single water quality data point for each household (HHWAT) and a range of water quality samples from 1-5 samples ...
1answer
51 views

### Which one is the correct specification to estimate Nonparametric regressions with discrete and continuous, using local constant estimator?

I was trying to implement manually the estimation of nonparametric regression using local-linear approximation with a mixture of discrete and continuous data. consider a simple model: $y=f(xc,xd)$ ...
0answers
15 views

### How to estimate marginal effect of x across categories that are not controlled for in a logestic regression?

I am trying to estimate the partial/marginal effect of variable x in a logit regression across a range of categories that I have not specifically used as control variable. More specifically, I have a ...
1answer
15 views

### How do the -me- commands in Stata deal with missing data?

I am running several melogit commands whereby I am accounting for clustering of individuals (it is a repeated measures design). So, I have melogit commands that look like this (increasing complexity). ...
1answer
60 views

### Test of equality between coefficients of different IVs across two different models

Say I have a categorical variable concerning the voting intention for ten parties, and I want to run two separate (logit) models for the voting intention of two parties in particular, Party A and ...