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.

Filter by
Sorted by
Tagged with
29 votes
1 answer
54k views

What is the non-parametric equivalent of a two-way ANOVA that can include interactions?

Hi I am trying to find the non-parametric equivalent of a two-way ANOVA (3x4 design) which is capable of including interactions. From my reading in Zar 1984 "Biostatistical analysis" this is possible ...
user35595's user avatar
  • 291
33 votes
2 answers
36k views

Why do I get zero variance of a random effect in my mixed model, despite some variation in the data?

We’ve run a mixed effects logistic regression using the following syntax; ...
Nick Riches's user avatar
378 votes
26 answers
136k views

Python as a statistics workbench

Lots of people use a main tool like Excel or another spreadsheet, SPSS, Stata, or R for their statistics needs. They might turn to some specific package for very special needs, but a lot of things can ...
14 votes
1 answer
6k views

Should I run separate regressions for every community, or can community simply be a controlling variable in an aggregated model?

I am running an OLS model with a continuous asset index variable as the DV. My data is aggregated from three similar communities in close geographic proximity to one another. Despite this, I thought ...
cadamt's user avatar
  • 269
18 votes
4 answers
42k views

Propensity score matching with panel data

I have a longitudinal data set of individuals and some of them were subject to a treatment and others were not. All individuals are in the sample from birth until age 18 and the treatment happens at ...
Andy's user avatar
  • 18.8k
4 votes
2 answers
3k views

Mboxcox, interpreting difficult regressions

Mboxcox in Stata suggests transforming my variables using a power of 0.1 for the independent variable, and 0.4 for the dependent variable. I have run the model, and it fixes problems associated with ...
Cesare Camestre's user avatar
35 votes
5 answers
80k views

Fisher's Exact Test in contingency tables larger than 2x2

I was taught to only apply Fisher's Exact Test in contingency tables that were 2x2. Questions: Did Fisher himself ever envision this test to be used in tables larger than 2x2 (I am aware of the tale ...
pmgjones's user avatar
  • 5,753
6 votes
1 answer
3k views

Acceptable values for the intraclass correlation coefficient (empty model)

I'm using xtmixed in Stata to test a Hierarchical Linear Model. My problem is that variance at level 2 is about 4% of the total variance. So most of the variance is ...
Forinstance's user avatar
6 votes
1 answer
31k views

Interpretation of marginal effects in Logit Model with log$\times$independent variable

I am totally confused by statistics and I would be glad if you could help me. I have a difficulties to interpret marginal effects in logit model, if my independent variable is log transformed. I ...
Alina Lobova's user avatar
19 votes
5 answers
74k views

How do I detrend time series?

How do I detrend time series? Is it ok to just take first difference and run a Dickey Fuller test, and if it is stationary we are good? I also found online that I can detrend the time series by ...
user58710's user avatar
  • 211
18 votes
2 answers
145k views

How do I interpret a probit model in Stata?

I'm not sure how to interpret this probit regression I ran on Stata. The data is on loan approval and white is a dummy variable that =1 if a person was white, and =0 if the person was not. Any help on ...
Kyle's user avatar
  • 1,209
13 votes
2 answers
29k views

Standard errors of a two stage least squares regression, Stata

I use Stata. I am trying to replicate the ivreg output of a regression performing manually the first stage, predicting the instrument after the first stage and running the second stage regression with ...
Charlie's user avatar
  • 491
9 votes
2 answers
13k views

How to replicate Stata's robust binomial GLM for proportion data in R?

There is an example on how to run a GLM for proportion data in Stata here The IV is the proportion of students receiving free or reduced priced meals at school. The stata model looks like this.: <...
Charlie Glez's user avatar
5 votes
1 answer
15k views

Fuzzy RDD issue

I am fairly new to econometrics and maybe this is a very basic question to some. I am running a Fuzzy Regression Discontinuity (RD) design in Stata and I am having doubts about whether I am ...
Luisa's user avatar
  • 51
2 votes
1 answer
7k views

Difference in Difference with multiple period (pre, during, and post treatment)

I was wondering if someone can help me understand how I should formulate my difference in difference regression. Under a basic two period DiD, I would be estimating an equation similar to: $$ y_{gt} = ...
grad_student's user avatar
55 votes
4 answers
68k views

Replicating Stata's "robust" option in R

I have been trying to replicate the results of the Stata option robust in R. I have used the rlm command form the MASS package ...
user56579's user avatar
  • 551
12 votes
1 answer
2k views

Which is the best method for network meta-analysis?

There are now several different approaches to perform a network meta-analysis or mixed treatment comparison. The most commonly used and accessible ones are probably the following: in a Bayesian ...
Giuseppe Biondi-Zoccai's user avatar
5 votes
2 answers
7k views

Comparing two or more treatments with inverse probablity of treatment weighting

I am working on a cardiovascular observational (i.e. non-randomized) study featuring three or more competing treatments. My preference would be to conduct the analysis first using 1:1 propensity ...
Giuseppe Biondi-Zoccai's user avatar
5 votes
2 answers
3k views

Strange results of varimax rotation of principal component analysis in Stata: rotated components are all zeros and ones

This is my initial output of Principal Component Analysis (PCA) using Stata and correlation matrix (because different scales and measurement units of inputs): <...
user2991243's user avatar
  • 3,941
3 votes
2 answers
13k views

Predicted Probabilities vs. Marginal Effects using at means or asObserved in Stata 14 Margins [closed]

This is a complicated question, and I'd very much appreciate any help I can get. I've been running on it nonstop for two or three days, and am running out of time. To be clear: This isn't so much a ...
Eric Click's user avatar
2 votes
1 answer
614 views

Help with needed with Fractional outcomes Logit Regression?

For my master thesis I am studying the effect of certain individual characteristics, such as financial literacy, on the probability of using a fintech. My dependent variable is a continuous variable ...
Jan Sommer's user avatar
14 votes
1 answer
27k views

Assign weights to variables in cluster analysis

I want to assign different weights to the variables in my cluster analysis, but my program (Stata) doesn't seem to have an option for this, so I need to do it manually. Imagine 4 variables A, B, C, ...
yumba's user avatar
  • 563
12 votes
2 answers
3k views

Should I bootstrap at the cluster level or the individual level?

I have a survival model with patients nested in hospitals that includes a random-effect for the hospitals. The random effect is gamma-distributed, and I am trying to report the 'relevance' of this ...
drstevok's user avatar
  • 550
9 votes
3 answers
151k views

How do you interpret results from unit root tests?

I have to do some unit root tests for a project, I'm just unsure on how to interpret the data (which is what I have been asked to do). Here is one of my results: ...
russel's user avatar
  • 91
9 votes
2 answers
7k views

SPSS and Stata output different

I'm Stata-proficient but learning SPSS for my new position. I am using a simple dataset to do very basic regressions and comparing to see if the results are the same. They're not. I'm close, but the ...
ShannonC's user avatar
  • 594
4 votes
0 answers
531 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 ...
Tom's user avatar
  • 379
3 votes
2 answers
29k views

Understanding standard errors in logistic regression

I am having trouble understanding the meaning of the standard errors in my thesis analysis and whether they indicate that my data (and the estimates) are not good enough. I am performing an analysis ...
Maria's user avatar
  • 31
2 votes
1 answer
3k views

Comparing proportions in two samples

(x-posted to Statalist) I have two (probably) independent samples taken from the same population under two different surveys conducted a few years apart. I'd like to check whether the frequencies for ...
goblin-esque's user avatar
1 vote
2 answers
505 views

Discrete choice model

I have a ordinal probit model. The dependent variable, say walkability, is a Likert scale variable (1,2,3). The main independent variable, say connectivity, is also a Likert scale variable (1,2,3). ...
numra's user avatar
  • 51
1 vote
2 answers
9k views

"variance matrix is nonsymmetric or highly singular" in Stata; no SEs in table

I get the above warning in Stata when I run a (clustered-panel pseudo-Poisson ML gravity-) regression. Observations are pairs of countries and the regression includes dummies for each combination of ...
asdir's user avatar
  • 145
20 votes
2 answers
9k views

Which diagnostics can validate the use of a particular family of GLM?

This seems so elementary, but I always get stuck at this point… Most of the data I deal with are non-normal, and most of the analyses based on a GLM structure. For my current analysis, I have a ...
RLang's user avatar
  • 341
14 votes
1 answer
26k views

How to do an instrumental variables regression with an instrumented interaction term in Stata?

I'm having a bit of a problem with Stata syntax. I need to do the following regression: $$y = ax + bz + c(xz) + e$$ where both $x$ and $z$ are instrumented and also the interaction term $xz$ uses ...
MiroA's user avatar
  • 141
11 votes
5 answers
9k views

How to compare 2 non-stationary time series to determine a correlation?

I have two data series that plot median age at death over time. Both series demonstrate an increased age at death over time, but one much lower than another. I want to determine if the increase in ...
Matt Hurley's user avatar
9 votes
2 answers
49k views

Hausman test for panel data, fe and re. Error in the estimation, what to do? Stata

I am performing a Hausman test on panel data to determine whether to choose Random Effects or Fixed Effects for my analysis. After performing the test I get this error: ...
Herman Haugland's user avatar
9 votes
4 answers
10k views

Very different results of principal component analysis in SPSS and Stata after rotation

For my PhD thesis I have to do a Principal Component Analysis (PCA). I didn't find it too difficult in Stata and was happy interpreting the results (I know there is a difference between factor and ...
hanne's user avatar
  • 93
9 votes
1 answer
37k views

GLM for proportion data in r [closed]

I have proportion data on the percentage of female employees in 500 organizations. I want to use GLM to explain this dependent variable using other independent variables such as company size, industry,...
Charlie Glez's user avatar
7 votes
2 answers
9k views

Standard error of the quotient of two estimates (Wald estimators) using the delta method

I have two coefficients' estimates from a regression, each of which has an estimated standard error. I would like to know the quotient of these two estimates -- that is, divide one of the estimates by ...
user1690130's user avatar
6 votes
1 answer
16k views

Difference between fixed effects models in R (plm) and Stata (xtreg)

I'm trying to re-create an analysis done using Stata function xtreg (though I don't have the code) with ...
gwatson's user avatar
  • 171
6 votes
1 answer
28k views

Within, between or overall R-square for random effects in Stata

I'm performing a random effects analysis on panel Data, and I haven't been able to find an answer to the question, which R-square should I look at: within, between or random? I know that for fixed ...
Herman Haugland's user avatar
5 votes
2 answers
2k views

How to draw a random sample from a Generalized Beta distribution of the second kind

For microsimulations, I (i) want to estimate parameters of an empirical distribution and (ii) draw a random sample based on the estimations. My random variable $Y$ seems to follow a Generalized Beta ...
Francesco's user avatar
4 votes
0 answers
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. ...
kathy kinga's user avatar
4 votes
4 answers
3k views

How to run svy: regress in R or get R-squared in R for complex survey data

I am trying to get r-squared, or explained variation, in a complex survey data using a linear regression (OLS). In Stata, this can be done by using svy: regress. In R, however, when I use 'survey' ...
slee's user avatar
  • 51
3 votes
1 answer
8k views

How to decide on the clustering of standard errors? (region- vs. country-level)

I'm estimating a first-difference panel data model with data on the regional level (~125 regions). All regions are part of a country (~12 countries). It seems intuitive to cluster the standard errors,...
Michiel Hennink's user avatar
2 votes
2 answers
3k views

Large coefficients and std. errors

I run a fixed effect model with Stata and because my dependent variable is a large number (max of 12 million and min of - 4 million), I got large coefficients for ...
Ben's user avatar
  • 195
2 votes
0 answers
2k views

Matching results completely different in R and Stata

I am trying to match treatment with the control using the R Matching package for the data set nuclearplants (which is available in ...
Metrics's user avatar
  • 2,652
2 votes
2 answers
19k views

Is it required for panel data to use dummy variables?

I am doing research considering seven countries and I have panel data. My question is: do I need to include dummy variables every time I use panel data in regression, or is enough to do it as a fixed ...
David Fernando's user avatar
2 votes
2 answers
6k views

How can one interpret the Stata output for Multiple Correspondence Analysis?

As an alternative to conducting exploratory factor analysis on a set of data, with binary responses, I have been suggested to use Multiple Correspondence Analysis (MCA). Following is a curtailed and ...
May Ank's user avatar
  • 21
2 votes
0 answers
3k views

F test and categorical variables

I am trying to compute a regression. I have a continuous dependent variable (investment in millions of dollars) One continuous independent variables Five dichotomous indicators (1 / 0) Four ...
Cesare Camestre's user avatar
1 vote
2 answers
455 views

Using variance from a Jeffreys prior in a Prevalence meta-analysis

I am doing a meta-analysis on a group of studies, where the observation is a rate (no. of successes / no of trials). Some of the studies have small sample sizes (n<10) and/or did not observe any ...
Kevin's user avatar
  • 13
1 vote
1 answer
385 views

Interpreting log linear margins with endogenous treatment effects

I'm having trouble in understanding the predictive margins after a log linear regression with endogenous treatment effects. Using stata (with weighted survey design) I ran the following, where logwage ...
iPlexipen's user avatar
  • 211