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.

1520 questions
4
votes
2 answers

Wrong confidence intervals using `margins` in Stata

I am using Stata 13.1 to fit a logistic model and I am getting confidence intervals below 0 and above 1 when I predict probabilities using the margins command. MRE: sysuse auto, clear * simple logistic regression logit foreign mpg * get predicted…
donlelek
  • 216
  • 3
  • 10
2
votes
1 answer

overall effects of categorical variables

I'm doing a Poisson regression in Stata, so the dependent variable is a count variable and I have some categorical predictors. If A is a categorical variable with, for example, 4 levels, in the parameter estimates table I get results for the 3…
anna
  • 69
2
votes
1 answer

esttab after margins?

I'm trying to output the average partial effects estimated after a regression but am having some difficulty. I realize using the margeff command works around this, but I have some interaction terms in my model and I can't get margeff to work with…
sam
  • 41
1
vote
0 answers

Suest for comparing Non linear regressions in Stata but show "estimation sample of the model saved under model1 could not be restored"

I am using suest to compare the results of Non linear regressions, use NLS_min1, clear keep if US==0 nl (LN_Q = {b0} + ln(1+ {A}*A1_min1+ {B}*B_min1)+{b1}*FirmID+{y1}*year_dummy1+{y2}*year_dummy2), variables(LN_Q A_min1 B_min1 FirmID year_dummy1…
Francis
  • 11
1
vote
1 answer

Estimating risk ratios in Poisson model in Stata

This is a coding question. Basically, in a Poisson model, I would like to calculate risk ratio between 10th percentile and 50th percentile (i.e., predicted value at 10th percentile divided by predicted value at 50th percentile) and 90th percentile…
1
vote
0 answers

What is the equivalence of optimizer in lmer in R and xtmixed in STATA?

I was trying to run a multilevel model in R using lmer and my model failed to converge with the default optimizer. Then I used the bobyqa instead of default optimizer and my model converged. Now I need to run the (same) model in STATA and I need…
Nicki
  • 11
1
vote
0 answers

Graphing in Stata with a dummy variable

I'm graphing a regression in Stata with a dummy variable, but my results look like this, which makes sense because obviously the dummy variable is either 1 or 0. But s there a better way to graph this result? This is my current code: graph twoway…
1
vote
0 answers

trouble finding an appropriate statistical analysis for my model

i am looking for an appropriate command on STATA to run it, hypothesis: PREDICTORS parent's social class (High education x below lower-white collar High education x professional Low education x below lower-white collar Low education x…
1
vote
1 answer

Can't Handle Data Set with Text in Byte-Format

I am a beginner, starting to use a new .dta data set in Stata. It has variables like schooling and gender with storage type 'byte', which implies they are integers. However the individual entries are "highschool" or "female". When I then try to…
1
vote
1 answer

Stata replacing missing values as well when using operators

I have a data set in which several observations have missing values, denoted by . (system missing). For the observations that actually do have values, I want to make a dummy variable with the value 1 if the observations have a value; otherwise the…
Paze
  • 2,291
1
vote
1 answer

Exponentiated Stata regression results (estimated coefficients, CI, SE, etc)?

Is there a way to exponentiate (ie, take antilog) of Stata's regression results table?
StatsScared
  • 1,218
1
vote
1 answer

Recalculating Survey Weight from combining two datasets in Stata

So I am working on a research project where I need to combine two datasets from a community survey given every year in NYC. I am combining years 2016 and 2017 which have the same variables used for each year, and each year has a respective survey…
Veronica
  • 11
  • 1
1
vote
1 answer

Stata's tsset in panel with two time dimensions

I have a panel of bond spreads. Spreads are from a specific issuer (firm) and maturity (eg 2, 4, etc years). The problem is that Stata's tsset (or xtreg) command takes two variables to set the data structure. In my case no two variables uniquely…
luffe
  • 265
1
vote
1 answer

Is it possible to conduct an alpha test on every bundle of 4 variables and only print that combo if alpha > X?

Basically, I have been experimenting with STATA for loops and am wondering if I could iterate over every group of four variables to run an alpha test and only print that bundle if alpha is higher than, say, 0.7. I have 200 different soil and air…
thewhitetie
  • 1,057
  • 1
  • 8
  • 7
1
vote
0 answers

Problem with replicating a paper

I'm having some trouble at replicating this paper (text here: http://www.michiganjb.org/issues/52/text52c.pdf) The paper wants to assess the economic impact of the Olympic games in the long run . The author has a big dataset cointaing data on GDPpc…
Luca
  • 11
  • 2
1
2