Questions tagged [statsmodels]

A Python module for exploration, testing, and estimation. Do not use this tag for general statistical modeling questions! Nb, questions only about the module itself, Python, or coding will likely be off topic.

Filter by
Sorted by
Tagged with
2
votes
0answers
2k views

Ljung-Box test p-values

I am using the Ljung-Box test from the python statsmodel package to test if there are autocorrelations in a time series. To make sure I understand the test, I am performing it on white noise and ...
2
votes
1answer
36 views

model building - regression in statistical analysis

I have a theoretical question regarding model building. I have some real empirical data, but I will present the problem in more general terms. I have two groups. I have a dependent variable, and an ...
1
vote
2answers
1k views

Mixed Effects Model with Pre-Post Dependent Variable

I have a dataset that most likely requires a mixed effects model, but which has a few quirks that make me want to confirm that my current modeling approach is correct. Background My DV is a ...
0
votes
2answers
4k views

statsmodels SARIMAX forecast has downward slope

I fit a statsmodels.tsa.statespace.sarimax.SARIMAX model (statsmodels==0.8.0) but I'm getting unexpected forecasting behavior, ...
0
votes
0answers
2k views

Running a Logistic regression - overflow error [duplicate]

I am running a logit regression and the "field1" is an existing list of 1's and 0's (which I am converting into a numpy list before passing as a parameter to Logit). I am trying to come up with a ...
0
votes
1answer
81 views

Possibility of performming Timeseries Modeling and forecasting on per second (high frequency data)

I want to perform an analysis on timeseries data which is measured per second. To give some context, it is a data of temperature of air at the exit of air heater. Fluctuations in data are either due ...
0
votes
0answers
2k views

Interpret regression model actual vs predicted plot far off of y=x line

I'm working in Python with statsmodels. I estimate an OLS multiple regression model (n=10763; 12 predictors; r^2=0.29) The model coefficients all have signs pointing the correct theoretical direction ...
3
votes
1answer
2k views

Why does matrix condition number change drastically when a constant is added?

If I create a regression model design matrix with 3 uncorrelated variables, I get a small condition number as expected. MWE: ...
0
votes
2answers
6k views

Regression model constant causes multicollinearity warning, but not in standardized model

I'm working in Python with statsmodels. I have a response variable y and a design matrix X from which I have already removed the ...
2
votes
1answer
2k views

Difference in R-squared observed from statsmodels when WLS is used

Recently I have been trying to solve one of my problems with OLS and WLS respectively, and was trying to determine whether a weighted regression would be more suitable by comparing the R^2 value. I ...
6
votes
0answers
7k views

Assessing A/B test results using Python

Problem's setting Assume having results of an A/B test. You let you users experience two variants of your website and you counted how many converted: ...
5
votes
2answers
14k views

Standard error of regression and of predictions in python (these are available in R) [closed]

I'm working with R and confirming my results in Python with the overwhelming majority of the work matching between the two quite well. There are two outputs coming out of R that I'm not seeing how to ...
1
vote
0answers
2k views

python StatsModels use training parameters for test data summary

I ran a linear regression on a month of hourly Nox concentration using StatsModels ols function. how can I get summary OLS Regression Results on the test data? I ...
0
votes
0answers
1k views

How to report results of a polynomial regression with a discrete independent variable

I have been recently trying to fit a linear model to my data. The dependent variable is continuous and the independent variable is numeric and discrete. When I first test the assumptions concerning ...
0
votes
0answers
63 views

negation of AR params in statsmodels

In this documentation there is a mention that "due to the conventions used in signal processing used in signal.lfilter vs. conventions in statistics for ARMA processes, the AR paramters should have ...
2
votes
1answer
538 views

statsmodels vs R for sample size estimation, why the difference? [closed]

Why does this R code: ...
2
votes
0answers
400 views

Sampling a statsmodel KDEMultivariate

I have been exploring kernel density methods in statsmodel that allow categorical variables but it seems that, unlike scikit learn kernel density implementation, there are no methods to generate ...
1
vote
0answers
1k views

OLS regression using the CAPM model in python

I've checked several posts here and haven't found what I'm looking for... The goal is to do a CAPM regression and assume that you have the following information: monthly prices for company AAPL, S&...
1
vote
1answer
629 views

In the ARMA model from the Python statsmodel library, what does the second order parameter represent?

I know ARMA is a combination of two models: The autoregressive model (AR) & moving average model (MA). Both models take up an order parameters which determines how many past data points will be ...
3
votes
2answers
645 views

How can I program correction for multiple comparisons using lsmeans in R while not correcting for more than necessary

I posted this question on stack overflow here enter link description here but did not get useful feedback. So, I'll post it again here, in the hopes that this is a better venue for it. I'm wondering ...
3
votes
1answer
202 views

How to deal with large number of times series?

I have a large number of times series (think of the order of 10k), one data point per day (think of the order of 100 days), so I have about 1M data points in total. (One of the things that I will try ...
1
vote
1answer
1k views

Adjusting Sample with Propensity Score Weighting and ATT

I have a retrospective sample that contains a treatment and non-treatment group with >10 covariates comprised of both categorical and continuous variables. I used the chi-squared and Mann-Whitney U ...
1
vote
1answer
2k views

How to write a logit and probit regression equation?

I have the following linear equation: Dummy dependent variable = dummy main independent variable + control variable 1, absolute value of changes (also between 0 and 1) + control variable 2, sigma (...
0
votes
1answer
2k views

Wondering what type of covariance correction for standard errors is better: Hansen-Hodrick or Newey-West?

I am wondering what type of covariance correction for standard errors is better: Hansen-Hodrick or Newey-West? Also, does someone know if StatsModels package that ...
2
votes
1answer
2k views

Why is Variance Inflation Factors(VIF) in Gretl and Statmodels different?

I have 3 variables R&D Spend, Administration and Marketing spends. I wanted to calculate VIF and eliminate a variable for better fit to the model. I tried to use the solution at ...
1
vote
1answer
243 views

Correlating categorical variables.

I have a collection of dummy variables. Each record has an entry in each category Income: Low, Low-Mid, High-Mid, High. Education: Low, Low-Mid, High-Mid, High. Occupation: Unemployed, Manual ...
6
votes
2answers
407 views

ARIMA model has trouble forecasting next month

I am implementing a statsmodels.tsa.arima_model.ARIMA model with daily advertising spend data. I have a dataset that ranges from Jan 1 2016 - present. Using a ...
2
votes
1answer
1k views

Normalizing weighted regression data

I'm performing a weighted least squares regression on survey data. The survey data is from the EU and each observation has a weight. (.4 for an one respondent, 1.5 for another.) This weight is ...
5
votes
2answers
7k views

Partial correlation in panda dataframe python [closed]

I have a data in pandas dataframe like: ...
0
votes
3answers
914 views

Logistic regression with categorical independent variables and binomial count dependent variables [closed]

The problem is from football. I have the full time goals(FTG), and shots on target minus goals(FST), as the dependent variables (integers). Team names, opponent team names (strings) and home field ...
0
votes
1answer
963 views

How to interpretate Box-Pierce results in Python? [closed]

I have made a prediction using an ANN. After that, I have created an error array, which values are the difference between the targets or real values and the predictions. Once this is made, I want to ...
2
votes
0answers
8k views

Variation Inflation Factor Gives inf

I have a dataset that contains 292 attributes. I want to calculate VIF to address multicollinearity in dataset. Here is a snippet which I have used to calculate VIF ...
3
votes
0answers
2k views

How to estimate weekly and daily seasonality for data with 15min frequency in Python?

I am relatively new to time series. My goal is to predict a few hours of data, measured every 15min based on three months of observations in Python. I assume I have daily and weekly cycles which I ...
11
votes
1answer
9k views

Why does statsmodels.api.OLS over-report the r-squared value?

I am using statsmodels.api.OLS to fit a linear regression model with 4 input-features. The shape of the data is: ...
1
vote
0answers
70 views

Can I do seasonal decomposition on a series on a rolling window basis?

I've been experimenting with the seasonal_decompose() feature from Python's statsmodels (equivalent to the same in R). The ...
1
vote
1answer
2k views

Size of bubbles in a influence plot

I'm running an OLS regression and using the Python package statsmodels to explore the role of residuals. Specifically, I am creating an influence plot as illustrated in this tutorial. I wonder why ...
5
votes
1answer
966 views

LOWESS implementation in Stata vs. R (and Python)

Recently I was comparing the output of LOWESS regressions performed in R (and using Python's statsmodels module) and Stata. I realized that some of the values obtained by Stata seem to be off; ...
1
vote
1answer
546 views

Determining seasonal differencing order [closed]

I have a situation where I want to automate the process of determining the order of seasonal differencing for time series data. The problem is I have been solving this in python and I didn't find any ...
5
votes
2answers
3k views

How do I test how “good” my Poisson Model is?

Background: coding in Python, utilizing pandas, statsmodels and scikitlearn (the former ...
1
vote
1answer
629 views

How does Python's statsmodel ARMA fit work?

Here is the documentation for statsmodel's ARMA fit function. My issue is that it does not specify the form of the model it is fitting, i.e. is it fitting $a(L)y_t = b(L)\epsilon_t$ or is it fitting ...
4
votes
1answer
1k views

“Zero-lag” for ARMA model

I am reading a statsmodels tutorial for generating and fitting ARMA models here. The author says The conventions of the arma_generate function require that we specify a 1 for the zero-lag of the AR ...
0
votes
1answer
3k views

How to get regression equation from statsmodel (python)

I am poor in statistics. I did a multiple linear regression in python by using statsmodels. I know that I can transform a non-linear relation into a linear relation ...
0
votes
2answers
8k views

How to solve multicollinearity problem in a linear regression? [closed]

I tried to do a OLS linear regression and got the following error message the end of the output: "2 The smallest eigenvalue is 1e-25. This might indicate that there are strong multicollinearity ...
2
votes
0answers
68 views

Measuring Difference Between Two Sets of Likert Values

I asked users to complete a likert survey (1-5) at the start of an activity and at the conclusion of the activity. What is the best manner to show the rate of change/difference between these two ...
1
vote
1answer
3k views

Logit in statsmodels give negative coefficents

I have a dataset of users with gender and a value "fr" ([0-1]) which I hope can be used to predict the gender. I tried fitting this data but contrary to what I expect and what make sense it predicts ...
1
vote
0answers
1k views

Partial regression plots for regularized (L2) linear regression

I'm trying to get to grips with multiple linear regression and partial regression plots. The answer to this question from @Silverfish really helped initially, so I had a go with my own data using ...
0
votes
1answer
3k views

Do I need to standardize data before doing regression with python statsmodels.OLS [duplicate]

Sorry if this is a naive question. The independent variables are truly having different scale. They need to be standardized. The question is, does statsmodels.OLS do standardization for us as its ...
13
votes
4answers
16k views

Statsmodels says ARIMA is not appropriate because series is not stationary, how is it testing that?

I have a time series that I am trying to model with Python's statsmodels ARIMA api. When I apply the following: ...
1
vote
0answers
304 views

Why are all my coefficients negative in my binomial regression, even though they are percentages that add to 100% for each group?

my git-hub file, demonstrating the problem I am trying to run a binomial regression on a dataset of groups that have taken a pass/fail test. I am working in Python, with statsmodels. My dependent ...
1
vote
0answers
24 views

Measuring effect size with two groups and one independent variable

I have conducted a study in which I am trying to assess how fast participants recognize familiar objects shown within white noise. Given my results, I suspect that for a given level of coherence(more ...

1
3 4
5
6 7