Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [stata]

Stata is a proprietary cross-platform general-purpose statistical software package.

0
votes
0answers
7 views

Industry and Year Effects in Panel data

I have a panel data set of 4500 firms for the years 2000 - 2017 (around 42,000 firm-year observations) a sample of which is shown below from Excel. I apologize as I do not currently have access to ...
0
votes
0answers
13 views

Is there any way to adjust (shrink) the unusually large predicted values after running a fixed effect model

I am trying to run a 2SLS and therefore, I need to use the predicted values from the 1st stage and use it in the second stage. Code from my 1st stage - ...
0
votes
0answers
11 views

Stata: not getting any calculation from logistic regression? [on hold]

I have a variable: treatment 0 and 1. I have independent variables hypertension 0,1 and gender 0,1. When I plug them into a logistic regression I just get no SD, yet it seems to come up with a ...
1
vote
0answers
9 views

Degrees of freedom for successive differences weights

I'm analyzing the American Community Survey integrated public use microdata using the 80 successive differences replicate weights supplied with the 2012-2016 5 Year sample. I'm following the helpful ...
3
votes
1answer
60 views

Can the “vif” function in Stata be used to estimate collinearity in regression models?

I watched a video on collinearity and Stata, and it seems the author of the video is trying to get the variance inflation factor (vif) below 4, as a number above 4 would indicate collinearity. Is it ...
0
votes
0answers
17 views

Logit's Marginal Effects at the Mean (Stata)

1)How to do logit's marginal effects at the mean? Is Option#1 or Option#2 correct? If it is not correct, can you please write a correct code for the marginal effect at the mean of the logit? 2)If it ...
1
vote
0answers
43 views

Prediction interval for log transformed variable in Stata [duplicate]

I want to predict $y$ with $x_1$ and $x_2$, including an out of sample prediction interval. However, $y$ has large outliers, so I log transform $y$ and estimate $\log(y) = a + b_1 x_1 + b_2 x_2 + e$, ...
0
votes
1answer
28 views

analyzing difference between two groups by other numeric factor with only (0-5) values

I want to analyze the difference between two groups by other factor. the factor is numeric with distribution (0-5) only. using Stata® what would be the best test to estimate the significance of ...
2
votes
1answer
33 views

How can I reproduce the gllamm() Stata function in R?

I'm currently working in a project, where I replicate a project that has been conducted with Stata. I, however, work with R. The task is to estimate a multi level logit model. In Stata, the project ...
0
votes
0answers
25 views

Determining a denominator for a baseline

I have a data request that I need to complete. The request is to create a baseline for specific referral form (called PIMR) that should be completed when a pregnant woman/infant has any of the ...
0
votes
0answers
25 views

Before-During-After Regression Analysis

I am currently trying to study the effect of the prolonged absence of the MVP in a basketball team on the performance of the team as a whole. Specifically, the idea was to create a regression model ...
0
votes
0answers
27 views

Stata: “Constraints dropped” issue in testing for IIA in multiple logit

I have a MLogit model for variable rd02 with 3 choices: Fight/ Stay/ Surrender. I am especially interested in "Fight vs. Stay" and "Surrender vs. Stay". Now I ...
0
votes
0answers
9 views

Validity of DiD estimator on PISA data

I am trying to investigate the effect of the 2007-2009 Financial crisis on education quality measured by the PISA scores. The proposed model to use is Difference-in-Difference with countries hit by ...
0
votes
2answers
32 views

Multiple comparisons repeated measures group by time interactions, with several time categories

I cannot understand how to analyse a really simple randomised controlled trial in R. I have two groups: Control and Intervention. Say there are 10 subjects in each group. These two groups are ...
0
votes
0answers
17 views

Robustness Checks

Built a stata regression model with 5 x-variables. When performing a robustness check, I removed a variable titled "residency", and when removed, it made a variable titled "surgery" more significant. ...
1
vote
1answer
21 views

Fixed effect and clustering with 3 dimensional data

I have a sample of banks. These vary across time, rating agency and across countries. UPDATE: I trying to capture the effect of a regulatory change (dummy variable, 0/1) on a banks credit rating. I ...
1
vote
0answers
13 views

Difference-in-difference model: using difference year ranges for variables

I am working on a project that involves using the difference-in-difference method and was wondering if will ruin the outcome if I use a different year range for my independent and dependent variables. ...
0
votes
0answers
9 views

Usage of both FE and RE model in panel data

depending upon the value of Hausman test, RE model has been chosen to run the panel data model of 275 data points. Random effects model does not consider the group effects such as the change due to ...
2
votes
0answers
16 views

Should I include gender dummy for the probit regression in Heckman?

I'm estimating the wage equation for a selected sample which contains both males and females, afterwards which will be decomposed using the Oaxaca command in stata, by gender. The wage equation for ...
0
votes
0answers
24 views

Power calculation for ordered logit regression in R or Stata

I am trying to estimate the sample size needed to have an effect size of 2.4, with power=0.8 and alpha=0.05. The outcome variable has 8 levels and each individual has 8 observations. The model has ...
0
votes
0answers
10 views

Correct classification of function of four-point trajectory

This graph depicts the output of group-based trajectory modelling (generated using the 'traj' plug-in in STATA). Strangely, the model has the highest AIC when all three trajectories are defined as ...
0
votes
1answer
51 views

What is the variance of the error term used by the logit command in stata?

I would like to compare the coefficients from the same model estimated by the logit and probit command. I think that the probit model is estimated normalizing the variance of the error term to 1. What ...
2
votes
1answer
65 views

In R, How can I calculate the elasticity of Y with respect to X, when Y is binary?

I have a dataset that I am doing in R and I need to calculate elasticities in it. To simplify my model, I have Y = XB + u, and I need to find the elasticity of Y with respect to X. My investigation ...
1
vote
1answer
118 views

Predicting probabilities after log-linear regression

I would like to estimate a log-linear regression and examine the results with Stata's marginsplot command. I have transformed my dependent variable into natural logarithm (to make a highly skewed ...
1
vote
0answers
34 views

Test equality between coefficients in STATA

I have a very basic question. I use two equations: \begin{equation} y_{it}=\beta*X_{it}+\theta*C_{it}+ \sigma_{i}+\tau_{t}+\epsilon_1 \\ z_{it}=\omega*X_{it}+\sigma*C_{it}+ \lambda_{i}+\gamma_{t}+\...
0
votes
0answers
63 views

2SLS IV with endogenous interaction in Stata: Difference between ivreg2 and manual estimates

I want to estimate 2SLS in Stata with two endogenous, continuous variables: $X_1$ and the interaction term $X_1*X_2$. The other IVs $X_2...X_N$, including the quadratic $X_2^2$, are all exogenous. I ...
1
vote
0answers
20 views

Is there any statistical problem on instrumental variable analysis with binary exposure and binary outcome?

I would like to conduct an instrumental variable (IV) analysis (a.k.a Mendelian Randomization analysis due to my IV is a genetic variant). In many cases as I searched before, an IV analysis was ...
0
votes
0answers
17 views

Comparing Demographics Of Observations Within Subgroups

I have a dataset of states with a variety of demographic characteristics of those states, as well as those states assigned to a geographic region (note that the first column is "fips", just that the ...
1
vote
1answer
33 views

What statistical methods would be recommended

What types of statistical analysis should I use to questions like: 1st question. Have you had problems standing for longer than 30 min? possible answers: no problems - had to adjust to be able - ...
0
votes
0answers
59 views

Implementation of quantile ARDL in R, EViews or Stata

I am working on time series analysis. I have squared returns as dependent variable. I want to regress it for knowing its causes. I have long T and small N data. I am looking for Quantile ARDL ...
1
vote
1answer
44 views

What is the difference between lsmeans in R and margins in Stata?

Context: I am using Stata to recreate someone else's analysis which was done in R. In Stata I have used the margins command to calculate the average adjusted predictions for a logistic model. I ...
1
vote
0answers
17 views

Is there any problem to conduct instrumental variables analysis with binary endogenous variable and binary outcome?

I would like to introduce "instrumental variables" in my study. In many cases, the outcome (dependent variable; DV) is a continuous variable. However, my study design has binary outcome (DV) and ...
1
vote
0answers
8 views

Choice of model for prognostic value of asymptomatic recurrence detection

I am involved in the final step of a project that evaluates the prognostic value of asymptomatic vs. symptomatic recurrence detection; all subjects experienced recurrence. The project proposed a ...
1
vote
0answers
43 views

Correct autocorrelation when using reg3 in Stata

I'm running a simultaneous equation model (three equations) on a time series dataset using reg3 in Stata. Some colleagues are concerned that the problem of ...
0
votes
0answers
39 views

Panel Data and Prediction/Forecasting

I have balanced panel data for around 130 countries, over three years. I ran a fixed effects regression using 'country' as my panel variable, and adding dummies for 'year'. I want to forecast the ...
1
vote
0answers
18 views

Deriving predicted probabilities from gologit2 (proportional odds models) output

I am trying to understand the output from Richard Williams's amazing gologit2 STATA package. The software is used for ordinal logistic regression and circumvents violations of the proportional odds ...
1
vote
0answers
37 views

marginsplot Stata: how to show MERs for categorical variables horizontally instead of vertically? [closed]

I ran an mlogit model in Stata. I then asked for the average marginal effects at representative values and now I would like to represent them in a graph. I have a ...
2
votes
1answer
112 views

Convert normal random variable into beta random variable in STATA

I need to generate two random variables - lognormal and beta distributed - while ensuring that the correlation between the two variables is -0.3. I generated two normal random variables with -0.3 ...
0
votes
1answer
278 views

propensity score matching with difference-in-differences for panel data

Research design utilizes companies that switched auditors (TREATMENT) and propensity score matched (PSM) companies that did not change their auditor (CONTROL). To obtain the propensity score for each ...
1
vote
0answers
11 views

Multiple Stage Hurdle Model Analyses

I have a dilemma over the application of double hurdle model. Here is a description of the data that I want to analyze: 1. Binary info on household purchase of different milk products 2. If ...
0
votes
0answers
36 views

Differences between Stata svy and R survey

I'm trying to replicate example 5.7 in Applied Survey Data Analysis (2nd edn). The text example is in Stata and I'm trying to replicate in R. With my svydesign object, I get exactly the same results ...
-1
votes
1answer
15 views

Concatenating distinct values contained within a string [closed]

I have a string variable (drugs) that contains a list of drugs prescribed at each line of treatment. I'm looking to create a new string that contains only the unique drugs from each line. In the ...
0
votes
0answers
32 views

Using B-coefficients from logit in a linear prediction equation (Stata 13)

This is probably basic, but the answer has eluded me so far... In Stata, if one runs the logit command, coefficient values are given. For the variables with p-...
0
votes
1answer
35 views
0
votes
0answers
30 views

Missing data in Stata

I have a GARCH time-series dataset of 5217 observations, spanning roughly 20 years. One of the variables, the trade-weighted US dollar index, misses 108 values, and as far as I can tell completely ...
1
vote
0answers
49 views

Full information maximum likelihood (Stata)

i have a (relatively complex) likelihood function that i would like to use to estimate my parameter coefficients. i have a data set with 412 observations for 19 variables. I'm fairly new to Stata, ...
1
vote
0answers
23 views

manually create categorical variable instead of fitting an interaction term

I am running a logistic regression model and I want to fit an interaction term between a dummy (female) and a categorical variable (risk level; 0/1/2). I was wondering whether creating my variable ...
0
votes
0answers
66 views

Bayesian logistic regression with priors from previous experiments (in Stata)

I am new to the world of Bayesian statistics - so I apologize in advance if my question is very basic. I've been looking for an answer a for a few days with no success. In short: Optimally, I would ...
2
votes
0answers
13 views

How to treat different status quo groups in a choice experiment?

I have a choice experiment where respondents choose between a status quo and one alternative. Before the choice questions, respondents are allocated to four different groups which determine the levels ...
0
votes
1answer
488 views

Clustered standard errors are completely different in R than in STATA

I'm trying to reproduce a study in R. Here are its core elements: study wants to measure the effect of a transit strike on highway delay independent variables: strike: binary dateresidual: ...