Skip to main content
10 votes

Regressors Became Statistically Insignificant Upon Correcting for Autocorrelation

One possibility is that both your dependent and independent variables are related to time. This is the source of many humorous correlations such as: Ice cream sales go up when sharks attack or ...
Peter Flom's user avatar
  • 125k
9 votes
Accepted

How to do maximum likelihood estimation when numerical derivatives cannot be calculated

There are optimisation algorithms that don't require derivatives. You can divide them into algorithms that assume derivatives exist but don't require them algorithms that don't assume smoothness A ...
Thomas Lumley's user avatar
9 votes

Cannot seem to find a statistical difference despite a clear difference in the dataset

I tried to replicate @dimitriy's results in Python and got slightly different results: ...
Igor F.'s user avatar
  • 9,418
6 votes

Cannot seem to find a statistical difference despite a clear difference in the dataset

You can detect a positive additive effect of both surgical and endovascular, though not surgical on its own. Jointly, both effects are marginally significant. These effects are relative to just ...
dimitriy's user avatar
  • 37.3k
6 votes

Regressors Became Statistically Insignificant Upon Correcting for Autocorrelation

Autocorrelation Influences My answer is a bit of a two-parter, the second part largely being more important than the first. First, a bit about autocorrelation... Consider the following data that I ...
Shawn Hemelstrand's user avatar
4 votes
Accepted

Interpreting a coefficient of a predictor not involved in an interaction term in a linear regression model with an interaction

As age is continuous, you would interpret the coefficient as all other variables kept constant, a one year increase in age leads to a 0.0488 unit increase in bmi.
cha116's user avatar
  • 56
3 votes
Accepted

Diff-in-diff with an unbalanced panel

With this kind of attrition, the bias will make the effect less negative, making the medication seem less effective at lowering BP. If the effect remains significant, you can say that with this kind ...
dimitriy's user avatar
  • 37.3k
3 votes
Accepted

Fixed effects regression: reghdfe vs reg with dummies (stata)

In R I get > mean(auto$foreign)*2446.5+4504 [1] 5231.338 so it looks as though reghdfe is estimating the intercept at the ...
Thomas Lumley's user avatar
3 votes
Accepted

What is the R Equivalent of this Stata Survey Weighting Code?

You've got the regular expression for the weights wrong. The example "wt[1-9]+" in the help page already matches any name starting with wt then a digit ...
Thomas Lumley's user avatar
3 votes

Double selection lasso in and NA's handling

One sort of a weak trick is to replace the missing values with some semi-reasonable number (you can use the mean), and code another variable missing_x = is.na(x) ...
StasK's user avatar
  • 32k
3 votes

AIC and BIC formula for multiple logistic regression in survey data in Stata

The usual formulations of AIC and BIC don't work under survey sampling because the estimation isn't by maximum likelihood. For example, if you had the same data but from a population twice as big, the ...
Thomas Lumley's user avatar
2 votes
Accepted

How to interpret margins in percentage points when the independent variable is a percentage?

In both of these models, your outcome and explanatory variable of interest lie in [0,1]. When you calculate the average marginal effect, you are getting the average change in the outcome associated ...
dimitriy's user avatar
  • 37.3k
2 votes

whether to adjust or not adjust for baseline in longitudinal RCT

I don't think the baseline should be explicitly modelled. If the treatment is randomly allocated, then groups are exchangeable, and their mean difference is 0. Rather, it would be a good idea to ...
Demetri Pananos's user avatar
2 votes

About regression analysis with categorical variables

You can attempt to build a multiple regression model. A standard approach to perform regression with categorical variables is called one hot encoding. You encode each categorical variable with $k$ ...
Marko Lalovic's user avatar
2 votes

About regression analysis with categorical variables

Multiple linear regression analysis could be an option. For polytomous nominal predictor variables, you would have to use binary code variables in the regression model (e.g., using dummy coding [0, 1] ...
Christian Geiser's user avatar
2 votes
Accepted

Stata and R giving different results for zero-inflated negative binomial regression

It looks to me that the two MLEs in the inflation model are $-\infty$ and $+\infty$, and it's just that Stata gets maybe one iteration closer to infinite before stopping. The count model parameters, ...
Thomas Lumley's user avatar
2 votes

US states - fixed or random effect?

Random effects are best used when you are trying to summarize a lot of variation between groups, people, or any other cluster of data (see lengthier discussion here). In this case, 50 clusters (states)...
Shawn Hemelstrand's user avatar
2 votes

Understanding differences in collinearity across Stata commands

reghdfe is different because, by default, it tries to deal with collinearity. I don't have Stata, but a little Googling found pages about this. It should be in the documentation for the program. The ...
Peter Flom's user avatar
  • 125k
2 votes

Multivariate Analysis for Personal Hygiene Product Survey

This is a tricky quant marketing problem with multiple complications. I am not aware of an easy solution. But I will try to outline how I think about the problem to point you in the right direction. ...
dimitriy's user avatar
  • 37.3k
1 vote

statsmodels: Update OLS' degrees of freedom when absorbing 3+ fixed effects

In R, the following correction restores equality of the (nonrobust) s.e.s of the residual-based regression to the fixed-effects based ones: ...
Christoph Hanck's user avatar
1 vote

About regression analysis with categorical variables

This really depends on what your research question is. If you're simply interested in the effect of the continuous variable, you can just run a regression and look at the Wald test for the coefficient....
Demetri Pananos's user avatar
1 vote

When I am comparing RMSFE between a log model and a level model of the same dataset, how should I proceed?

It is much easier to keep the AR(2) forecast, which is already on the original scale, and transform the AR(5) forecast from the log scale to the original scale. However, simply taking the exponential ...
Stephan Kolassa's user avatar
1 vote

High t statistic with high p value for same variable?

Your standard error is adjusted for only 2 clusters. That doesn't look right. It's hard to find a definitive answer to the minimum number of clusters (the book 'Mostly Harmless Econometrics' suggests ...
Jeremy Miles's user avatar
  • 18.3k
1 vote

Interpreting Significant Interaction Term Odds/Hazard Ratio with Binary Variables

See https://stats.stackexchange.com/a/636401/4253 which is not written for any particular model such as the Cox PH model, but works generally.
Frank Harrell's user avatar
1 vote

any problems with Firths Logit model (to deal with separation)

Partially answered in comments: No time to provide an elaborate response, but Greenland recommends log-F(1,1) prior instead of Firth's bias correction method. And you can implement it by simply ...

Only top scored, non community-wiki answers of a minimum length are eligible