# 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.

411 questions
Filter by
Sorted by
Tagged with
28 views

### State space models in python statsmodels: including lag state innovation in observation equation

I am trying to fit the following state space model via the (excellent and highly useful) statsmodels state-space module. The model is a standard local level model but where last period's innovation ...
12 views

### Simulating Ordered Logit Model with Statsmodels in python

I am trying to recreate an analysis in which the first step is creating an ordered logit model to predict class probabilities. The model is: y' = βx + error, error ∼ L(μ|σ), μ = 0, σ = π/√3 To ...
11 views

### Finding Confidence

I am running A/B testing . Created 4 groups with 3 group as variant and one as Control. I found the confidence values for this hypotheses More Number of events(Group) per day Drive Higher Uninstalls ...
19 views

### One-sample hypothesis test for population proportion [closed]

I'm stuck folks. Help an old lady out will ya? Here's what I've got to complete: Load the gpa.csv data set. Find the number of students with a gpa greater than the user input value. Find the total ...
• 1
1 vote
22 views

### Fitting TVP-VAR statespace mlemodel in statsmodel

1 Thanks to everyone in advance for their time! I am trying to run a TVP-VAR for a panel in the statespace mlemodels in statsmodel. I get an error while trying to fit the model ...
• 21
30 views

### What's the difference between statsmodels' RLM and robustbase's glmrob?

The Python package statsmodels comes with robust models of linear regression (RLM, https://www.statsmodels.org/stable/rlm.html). ...
1 vote
5 views

### Can I run a Manova after conducting a cluster analysis?

So my study intends to conduct a cluster analysis using 2 variables (RP and AP). I intend to find four clusters (AC, BC, CC and DC). I would then like to examine differences in education, height, age, ...
• 11
1 vote
23 views

### SARIMAX prediction: including 'deterministic polynomial trend'

I'm wanting to use Statsmodel's SARIMAX model to predict sharemarket values into the future. This is part of a larger effort towards helping strictly non-profits and social-enterprise organisations. ...
1 vote
60 views

### "SVD did not converge" while using statsmodel.timeseriesanalysis.MarkovRegression

I am trying to fit a MarkovRegression model sm.tsa.MarkovRegression(spread, k_regimes=2, switching_variance=True) to a time series of price spread. This is the ...
30 views

15 views

### linear mixed effects model comparing recorded data to 'random' control data

I'm new to mixed-effects models and have some questions about the best way to analyze my data. Experimental Design: I have x-y coordinates for groups of 5 fish swimming around freely in a tank. We are ...
• 97
9 views

### Forcing Statsmodel Formula regression through Origin [duplicate]

I wrote following code model1 = smf.ols(formula="Annual_Sales ~ Confidence_Match_Score + Annual_Sales + 0", data=df).fit() Now using the above the code ...
34 views

### How to use log-likelihood for linear mixed model selection using statsmodels

I've ran a linear mixed model using statsmodels and obtained the follow result: ...
• 23
1 vote
357 views

### Getting confidence interval for prediction from statsmodel Robust Linear model

I'm using statsmodels to fit a statistical model. I have a formula that is fitted like this: ...
• 143
207 views

### Linear Mixed Model R2 Calculation using statsmodels

I've ran a linear mixed model using statsmodels and obtained the follow result: ...
• 23
32 views

### statsmodels.adfuller weird behaviour of usedlag value

I'm learning about time-series analysis and have two series on which I'm performing an Augmented Dickey-Fuller test in order to check for stationarity. I'm trying to understand why I get very ...
• 101
86 views

### Getting different AIC / BIC values for AR(2) estimation via AutoReg(2) vs ARIMA(2,0,0) through python statsmodels

I am trying to fit an AR(2) model to a data series claims_df['initial claims'] via statsmodels.tsa.ar_model.AutoReg and ...
12 views

### Winning Bid probability [duplicate]

I had asked this question earlier, but I guess I was too late to respond to the questions. Hence reposting. Top 10 win probabilities I have a task at my hand to create some kind of model that can help ...
486 views

### Doubts with cross correlation in Python's statsmodels

I have been trying to understand statsmodels.tsa.stattools.ccf, the cross correlation between two random vectors and I tried ...
• 281
22 views

### what formula does python statsmodels library uses to compute the bp_stat value (the Q value for the Box Pierce test)

As far as I know, the $Q$ statistics is computed with the formula $Q = N \sum_{j=1}^K \rho_j^2$ I created an example where I compute $Q$ by hand and by using:\ ...
34 views

### Help Johansen test interpretation for co-integration confirmation

I have run following test ...
• 51
53 views

### Top 10 win probabilities

I am a newbie here, hoping to find the right response for my question. I have a task at my hand to create some kind of model that can help me to determine what is the chance of winning a certain ...
79 views

### Replicating a nested mixed effects model in R using python statsmodels

I am using this tutorial that is written in R to build a nested mixed effects model. The R code is as follows: ...
94 views

### Linear model coefficient has a high p-value (insignificant) but the fitted value looks perfect

I have made an OLS model using statsmodels in python, in an attempt to model the response variable: energy cost per tonne. Note: ...
• 125
20 views

### How to improve statsmodels SARIMAX forecast [duplicate]

I am trying to improve my statemodels SARIMAX model compared to the below naïve forecaster. Naive forecast = y.mean() + ( X-X.mean() ) * y.std() / X.std() where X is a series that has .75 ...
• 1
17 views

### Is the likelihood of a discrete binomial variable same as it probability? Like in the case of tossing a coin lets say 12 times

I am working on a probability project where we first generate random variables for a given Binomial experiment and then we generate a PMF for 10 coin tosses using the list of random variables we ...
1 vote
63 views

### How do you calculate F-value for three groups, given only the mean and standard deviation in Python

I am learning about power analysis for different scenarios in Python, e.g. for three groups (assuming equal sample in each group). I've seen videos demo for SPSS and other softwares, where you simply ...
1 vote
38 views

### Modifying covariance structure in statsmodels mixedLM

I am using the following command to fit a linear mixed model for repeated measures (MMRM) in statsmodels: ...
• 31
94 views

### Explained and Unexplained Effects don't add up to gap in Oaxaca-Blinder decomposition (statsmodels)

Here's a Python implementation of Oaxaca-Blinder decomposition analysis using statsmodels. First, how do I interpret the negative value for Explained Effect here? ...