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.

1
vote
0answers
26 views

Model Selection with Time Series Analysis

I'm new to time series and would like some help to determine the parameters for my analysis. I have minutely data for a few months and this is how a random week looks like. I ran the Augmented ...
1
vote
0answers
50 views

Calculating standard errors of non-OLS regressions in python and scipy [on hold]

Scipy/statsmodels provides the ability to get a number of metrics from the output of an OLS regression model, a few examples of which (from statsmodels) are the following: ...
0
votes
2answers
31 views

Same model coeffs, different R^2 with statsmodels OLS and sci-kit learn linearregression

I'm getting to know Python regression tools with the intention of benchmarking against ML tools available on a couple of cloud based services. I'm using the boston dataset distributed with scikit-...
0
votes
0answers
35 views

Warning: Maximum number of iterations has been exceeded. Statsmodels Logistic Regression [closed]

I am trying to train a Logit model using the statsmodels api and I get the following error message. ...
-1
votes
1answer
33 views

Statistical technique to combine scores from multiple tests

In my experiment I have two groups, one group has an anxiety disorder (N = 22), the other does not (N = 11) (I know low sample size). They were tested in a battery of psychological tests and also ...
0
votes
0answers
13 views

How to make a combined score from multiple test

I have a bunch of tests done on individuals who have a genetic susceptibility to ADHD and others who don’t have that susceptibility. I have to come up with a point system to score these individuals to ...
1
vote
1answer
28 views

Removing multiple seasonalities from time series

I'm using statsmodels.tsa.seasonal.seasonal_decompose to remove seasonality from a time series. I can remove a seasonal component in this way: ...
0
votes
0answers
6 views

What is the difference between the p parameter in ARIMA(p,d,q) and the lag value used by AR?

I understand that p represents the order of the AR model used within the ARIMA model, but does that have anything to do with the lag value that is calculated by the IC (eg. aic, bic, hic) in the AR ...
0
votes
1answer
15 views

statsmodels ARIMA predict function on in sample data points [closed]

I'm trying to use the ARIMA predict function to predict on any test sample--this could include both in sample and out of sample data points, however the frequency will be fixed and equal to the ...
0
votes
0answers
27 views

Manually computed AIC differs from statsmodels AIC

I tried to manually code a formula for the AIC. I want to use it in connection with scikit learn. For testing if i coded correctly, I compared the AIC values from statsmodels given the same datasets. ...
0
votes
1answer
13 views

How to interpret cell values from statsmodels contingency table methods?

The documentation for the methods in statsmodels.stats.contingency_tables.Table is sparse; for example, for fittedvalues() it describes it "returns fitted cell ...
0
votes
1answer
23 views

Repeated measure correlation in Python

I'm trying to see if there's correlation between two variables over days for different individuals. I have 100 individuals' data over 60 days. For each day, I have the distance traveled on that day ...
-1
votes
1answer
29 views

How to test seasonality of time series using One way ANOVA test?

I did perform a one way ANOVA test on my data, I'm having problems understand the results, my p-value is 0.0721 .
1
vote
1answer
41 views

Dummy/baseline models for time series forecasting

I am working on an evaluation of time series forecasting models in Python, more specifically with statsmodels, scikit-learn and tensorflow. I think it makes sense to first compare the model ...
0
votes
0answers
13 views

Importance of tests summary in multiple regression using statsmodels

Greetings to the community. I have a practical question regarding the interpretation of the summary statistics that you get from statsmodels when you fit a model. I have e.g.,: model = smf.ols(...
0
votes
0answers
47 views

McNemar or Cochran's Q for evaluating multiclass classifiers?

full disclosure: I did a semi-cross post of this question due to low traffic. Once I get an answer on any of the two questions, I will link the answer back to the respective other. tl;dr For ...
3
votes
2answers
133 views

Does the dependent variable in a GLM have to be transformed before running the model or does the model do it?

I'm trying to fit a Tweedie model with statsmodels and was wondering if I have to transform the dependent variable before I run the model or if ...
0
votes
1answer
257 views

Why do I get NAN for p-values while using statsmodels logit function?

My data I used statsmodels to build a logistic regression as follows: ...
0
votes
0answers
103 views

Statsmodels Kalman Filter: simple equivalent to pykalman set up (partly answered)

Following some examples on Chad Fulton's blog and in statsmodels' tests, I have tried to come up with an equivalent of a pykalman implementation. The original question was deemed unclear and was ...
0
votes
2answers
263 views

Fitting pmf of a scaled Poisson distribution and Python histogram plotting

I have a nuclei meanlife of $550\mu s$, for which I've taken the frequency(rate) to be $1/meanlife = 1818$. I then sampled randomly from a poisson distribution with that frequency, taking the ...
1
vote
1answer
22 views

Why do you set 1 as intercept in linear regression model in python?

I'm learning linear regression in Udacity as a beginner. I know statsmodels.regression.linear_model.OLS() needs interception but why do you set ...
0
votes
2answers
83 views

Relaxed Lasso Logistic Regression: Estimating second penalty parameter

I'm trying a relaxed lasso logistic regression by first using sklearn's cross validation to find an optimal penalty parameter (C = 1/lambda). Then, I use that parameter to fit statsmodel's logit model ...
0
votes
1answer
161 views

Manually calculate SARIMAX forecast

I'm trying to manually replicate the forecast that I obtained using statsmodels.api sarimax (python). Its actually just an AR(1) model with one exogenous variable, in the form of SARIMAX(1,0,0)(0,0,0)...
1
vote
0answers
138 views

Statsmodels VECM - Predicting out-of-sample

After fitting a VECM model, I would like to study its out-of-sample behavior but haven't been able to find a way to do it. More precisely, given X_train and ...
0
votes
2answers
283 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
645 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
28 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
45 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
94 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
65 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
69 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
82 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
36 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
151 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 ...
2
votes
1answer
455 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
449 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 <...
1
vote
1answer
737 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
451 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
383 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
257 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
101 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
45 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
81 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
444 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
161 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
94 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
262 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
34 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
688 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 ...