Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
2answers
37 views

How can one interpret a heat map plot

I am doing a stats assignment in python and during my preliminary data analysis I created a heatmap plot and would like to be able to explain the correlation among the variables. However, I don't ...
0
votes
2answers
53 views

StatsModel Logistic Regression

I am running a fairly simple Logistic Regression model y= (1[Positive Savings] ,0]) X = (1[Treated Group],0) I got a coefficient of Treated -.64 and OR of .52. My question is how to interpret the ...
0
votes
0answers
15 views

Expected differences in charts when plotting additive vs multiplicative seasonal decomposition charts?

I've started studying time series analysis and I'm looking at additive vs multiplicative models. I've taken a sample dataset of flights and I've used python statsmodels to plot the seasonal ...
0
votes
0answers
23 views

Goodness of Fit Tests for Logistic Regression [duplicate]

I am trying to build a logistic regression model from a data set with several different features, and ~500 entries. Some of these features are discrete, some are continuous, and some are binary. What ...
0
votes
0answers
23 views

Statistical Model for multivariate timeseries

I'm new to timeseries prediction and I would like to try several classical methods before getting into more complicated model. Concretely, I have a multivariate timeseries of ...
0
votes
0answers
23 views

Dealing with correlated variables and choosing between models

One of the things I've always been confused about is the framework around model selection in the cases where $n$ predictor variables $x_i$'s are correlated. My thoughts on the different approaches: ...
2
votes
1answer
44 views

Removing Variance in Time Series After Applying Log Transformation

I'm trying to look at natural gas prices from 2003-2018. The issue is after applying log transformation and then diffrencing data by 1, I still seem to get an increase in variance from mid 2014-2018. ...
0
votes
1answer
42 views

Different regression coefficients from statsmodels OLS API and formula ols API

I work at a relatively large Swedish retail company where I am currently performing initial linear regression in order to understand the linkage between dependent variable store sales (number of ...
0
votes
0answers
21 views

Abbreviations: StatsModels handling NaN

In StatsModels there are keywords to specify how to deals with NaNs. 'none' := no checks for missing values 'drop' := drops missing values 'raise' := raises an error But there is another keyword: '...
0
votes
1answer
49 views

within-subject regression analysis

I have three levels (suppose A,B, and C) in my experiment and wish to do within-subject regression analysis. All the 3 levels are manipulated within-subject. Also A is outcome category, B is outcome ...
1
vote
1answer
192 views

Python ARIMA generates different predictions than SARIMAX for same orders

I was under the impression that Python Statsmodels SARIMAX with seasonal order parameters set to 0 will generate the same forecasts as ARIMA. But apparently the forecasts are wildly different. What ...
0
votes
0answers
174 views

Why are the critical values in coint_johansen in statsmodels in Python so different from the ones in ca.jo in urca in R?

When i run the same johansen test across Python and R I get very different critical values. If I normalize the two columns in <...
0
votes
0answers
62 views

regression change point model

I am novice at best with linear regression models and I am interested to learn how to do a change point model in Python if possible. The data that I analyze is a years worth of electrical energy (kWh) ...
1
vote
1answer
312 views

Paired samples t test in Python

I'm trying to conduct a paired samples t-test in Python (statsmodels package), but I don't see a function for it in their documentation. The closest I can find is ttost_paired, but I don't think its ...
0
votes
1answer
156 views

Statsmodels' Negative Binomial: after .fit_regularized(), how to turn PMF into PPF to get the discrete values?

I used the package statsmodels to fit a Negative Binomial to my data. This data contains ~1500 samples with 21 covariates. Since I have overdispersion in my data ...
0
votes
1answer
204 views

2-way ANOVA in Python statsmodels yields different Sum of Squares than SPSS

I am learning to use Python for my statistical analyses, and while figuring out how to perform a 2-way ANOVA with statsmodels I found that my Python code yielded slightly aberrant values. Comparing ...
2
votes
1answer
114 views

Apply statsmodels PCA to new data

I am working on a personal project, and I want to use Statsmodels' PCA on a dataset. The ultimate goal is to then perform a linear regression and evaluate its prediction. I know scikit-learn may be ...
0
votes
1answer
57 views

Ljung-Box test on a out of sample residue with good forecast

To test the fbprophet library, I created a very simple synthetic series and generated a model like this: ...
4
votes
1answer
41 views

Appropriate Distribution for Survival Probability Parameters

I have a model that assumes a probability of survival over discrete time (example: decades) ...
0
votes
1answer
53 views

zero inflated poisson iregression AIC values

Im trying to regress count data (DV). There are a few IV's both continuous and categorical. Frequency count of my DV as show below.Two groups , treatment and control. About 75 % are zeros. ...
0
votes
1answer
202 views

Tukey HSD plot_simultaneous - how does it work?

I have performed a Tukey HSD in Python. I am not sure what values are plotted when using the .plot_simultaneous() command (see statsmodels documentation). The resulting plot is: I am wondering: how ...
0
votes
0answers
101 views

Are these Granger-causality F-tests equivalent?

I am comparing results of a Granger causality implementation I wrote in Python to the established package statsmodels, and noticed that the equation implemented has a scaling factor equal to the ...
0
votes
0answers
21 views

How to interpret regression results when there are categorical independent variables? (statsmodels | python) [duplicate]

I'm using a toy dataset from sklearn and adapted it for a linear regression framework. In this example, I'm constructing a ...
0
votes
2answers
91 views

Is this linear model overfitting when I add more parameters?

I am trying to figure out if my models are overfitting. This is a trend I noticed with my actual dataset associating metadata with compositional data. The more parameters I add, the better the ...
8
votes
2answers
5k views

Can we say 50% of data will be between 25th-75th percentile?

Let's say we have the following dataframe: ...
1
vote
0answers
27 views

How does Noise affect the results of Transfer Entropy?

I was reading about Transfer Entropy and came across this package: https://cran.r-project.org/web/packages/TransferEntropy/TransferEntropy.pdf The code in the package: ...
0
votes
3answers
315 views

SARIMAX(1,0,0)(0,0,0,0): Regression with ARMA errors or ARMAX?

I'm trying to unravel the influences of various exogenous regressors on a time series dataset. I'm getting good results with a sarimax(1,0,0)(0,0,0,0) specification, but I'm confused about the ...
7
votes
1answer
559 views

The identity link function does not respect the domain of the Gamma family?

I am using using a gamma generalized linear model (GLM) with an identity link. The independent variable is the compensation of a particular group. Python's statsmodels summary is giving me a warning ...
0
votes
0answers
108 views

ADF test and seasonal series

Hi I'm new in the time series field and so I've different doubts. Considering this dataset https://archive.ics.uci.edu/ml/datasets/Individual+household+electric+power+consumption And considering ...
1
vote
2answers
97 views

Nonlinear regressor in GLM link function

Try to reproduce Robert E. McCulloch and Ruey S. Tsay’s paper Nonlinearity in High-Frequency Financial Data and Hierarchical Models with local market data. the paper uses GLM to model high-frequency ...
0
votes
0answers
233 views

Discussion of a parameter in the python statsmodels augmented Dickey Fuller test

I would like to use the adfuller test from statsmodels.tsa.stattools, but I'm not sure when to change the parameter ...
1
vote
0answers
83 views

How to make statsmodels treat timeseries values as continuous? [closed]

This is basically a copy of the stackoverflow question here, which never received an adequate answer. The problem is that the Python's statsmodels package insists ...
1
vote
0answers
23 views

Which model for testing “has this binary variable changed over time?”

I am trying to figure out if a list of historical documents (N=50) drifted from one value of a binary variable $w$ to the other. Users have given 1 to 5 votes whether they think they think the ...
3
votes
2answers
843 views

Why is gradient descent so bad at optimizing polynomial regression?

As part of a self-study exercise, I am comparing various implementations of polynomial regression: Closed form solution Gradient descent with Numpy Scipy optimize Sklearn Statsmodel When the ...
1
vote
2answers
131 views
1
vote
1answer
397 views

Interpretation of PACF and ACF plots [duplicate]

I am trying to fit an ARMA model to a time series of a power spectral density values that I have calculated. Here is the plot of the data: with corresponding autocorrelation and partial ...
0
votes
0answers
210 views

Convergence Warning while Determining the order of ARMA model using arma_order_select_ic

I have got around 150 companies returns' data and I am trying to determine the arma order of p and q for each company. I came across the arma_order_select_ic function in the statsmodel library and ...
0
votes
1answer
67 views

Can log-likelihood of the data decrease when adding parameters in a linear mixed model?

I'm trying to fit different linear mixed models in the context of model selection. I'm using the StatsModel Python package in order to do that. However, I encounter a very strange phenomenon. Say I ...
2
votes
0answers
718 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
30 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
372 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
1k 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
545 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
74 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
334 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 ...
2
votes
1answer
292 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
734 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 ...
1
vote
1answer
657 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 ...
0
votes
0answers
17 views

Minimum how many variables required for running GzLM or GAM?

I am interested to find, out of 3 different traps (Treatment), which trap catching more insects (Responder). Data is not normally distributed and overdispersed. Here is my data; ...
4
votes
0answers
2k 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: ...