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.

Some other sources of Stata help:

'Stata' is an invented word, not an acronym, and therefore should not have all its letters capitalized (i.e. 'STATA' is considered incorrect). See the last item of the Statalist FAQ.

1424 questions
376
votes
26 answers

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 be done with a simple spreadsheet or a general…
Fabian Fagerholm
  • 215
  • 3
  • 6
  • 7
54
votes
4 answers

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 and also the command lmrob from the package "robustbase". In both cases the results are quite different from the "robust"…
user56579
  • 541
  • 1
  • 5
  • 4
32
votes
5 answers

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 of him devising the test while trying to guess…
pmgjones
  • 5,543
  • 8
  • 36
  • 36
30
votes
2 answers

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; # fit model fm0 <- glmer(GoalEncoding ~ 1 + Group + (1|Subject) + (1|Item), exp0, family = binomial(link="logit")) # model output summary(fm0) Subject and Item…
Nick Riches
  • 521
  • 1
  • 5
  • 12
27
votes
1 answer

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 using a method put forth in Scheirer, Ray, and…
user35595
  • 271
  • 1
  • 3
  • 4
20
votes
1 answer

Standard error of random effects in R (lme4) vs Stata (xtmixed)

Please consider this data: dt.m <- structure(list(id = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), occasion = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,…
Robert Long
  • 53,316
  • 10
  • 84
  • 148
20
votes
2 answers

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 response variable that is "walking speed"…
RLang
  • 341
  • 2
  • 6
17
votes
4 answers

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 some age in between that range. The age of the…
Andy
  • 18,070
  • 20
  • 77
  • 100
16
votes
2 answers

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 how to read this would be greatly appreciated.…
Kyle
  • 1,119
  • 6
  • 13
  • 22
16
votes
1 answer

2SLS but second stage Probit

I am trying to use instrumental variables analysis to infer causality with observational data. I have come across a two-stage least squares (2SLS) regression which is likely to address the endogeneity issue in my research. However, I would like to…
Veronica
  • 163
  • 1
  • 4
15
votes
4 answers

Why does a confidence interval including 0 mean the difference is not significant?

Could someone please explain why zero being inside or outside the confidence interval tells you whether or not the difference is significant?
Sara
  • 151
  • 1
  • 1
  • 3
15
votes
5 answers

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 doing this in Stata: reg lncredit time predict…
user58710
  • 171
  • 1
  • 1
  • 4
14
votes
1 answer

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, D. The weights for those variables should be…
SPi
  • 553
  • 1
  • 6
  • 18
14
votes
4 answers

R/Stata package for zero-truncated negative binomial GEE?

this is my first post. I'm truly grateful for this community. I am trying to analyze longitudinal count data that is zero-truncated (probability that response variable = 0 is 0), and the mean != variance, so a negative binomial distribution was…
Iris Tsui
  • 681
  • 4
  • 14
13
votes
3 answers

Is the Mundlak fixed effects procedure applicable for logistic regression with dummies?

I have a dataset with 8000 clusters and 4 million observations. Unfortunately my statistical software, Stata, runs rather slowly when using its panel data function for logistic regression: xtlogit, even with a 10% subsample. However, when using the…
Tom
  • 469
  • 3
  • 9
  • 23
1
2 3
94 95