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

349 questions
Filter by
Sorted by
Tagged with
29 views

### Statsmodels tests for proportions give different results than other software

An example from Primer of Biostatistics by Glantz: 8 patients out of 61 died while undergoing heart surgery with one anesthetic. With another anesthetic, 10 patients died out of 67. If we use R, chisq....
43 views

### How can I edit this code to determine the accuracy of data? [closed]

My employer has asked me to perform a few analysis on a data about wood piles which contains their diameter and bark thickness. I am a beginner in R and started with some basic descriptive analysis ...
29 views

### How To Approach Fit Method Selection for SARIMAX Models

I am building SARIMAX models using the statsmodels library in Python. Some of these models are single variable models and some are multi variable models. In general, I am finding that I get very ...
22 views

### Why is the mean of confidence interval the same as the coefficients in Logistic Regression?

I'm currently using statsmodels library to train a Logistic Regression. However, I noticed that logit.conf_int().mean(axis=1) and logit.param generates the same values. Why is that? What am I missing ...
69 views

### Different results for ANOVA power calculation by R and statsmodels

I am studying statistics now so the example is from a textbook. We have 3 groups with means 11.5, 10.1, 9.1 but want to see what would be the test power for a difference of 1.0. So for this assumed ...
25 views

### Studentized residuals when I have an observed and predicted value in a dataframe without a model in Python?

I have data that contains observed and predicted values in a dataframe - thus the residual can be calulated. But, how can I calculate and plot Studentized Standardized Residuals without building a ...
12 views

### How to generate a state space model from data?

I am trying to identify a state space model from discrete time series data in Python using statsmodels library: ...
16 views

### What units are the cumulative response functions of a VAR measured in, and why does orthogonalisation appear to change the scale?

There are quite a few questions on this site regarding the interpretation of the impulse-response-function plots of a VAR, but none answer my query directly. I will attempt to be as concrete as ...
15 views

### Impulse response function of the exogenous variable in a VARMAX model

I am learning about VAR models "by doing", so to speak. I am using statsmodels; comparing the documentation on VAR and VARX models, I would like to ...
16 views

### Understanding how seasonal terms are calculated in unobserved components model (statsmodels)- python

Context I am running an unobservedcomponents model from statsmodel api in python The data is daily in nature , and these are the parameters I have set for my model: I have a day of week pattern in ...
33 views

### Interaction for dummies

I used an OLS regression to find correlation between wage gaps and skill similarity in a paired combinations data (ie. A|B, A|C, B|C). To expand the analysis, I included workplace gender distribution ...
20 views

### SARIMAX's predictions are pretty inaccurate - what am I doing wrong?

I have flu incidence rates from 2009 to 2014. I have also multiple columns with environmental with mean, max, min temperature, mean, max, min humidity, mean, max, min rain + couple of extra ones. The ...
42 views

### ARMA Model constant estimation in statsmodels library

I have a question concerning the statsmodels library, I am just trying to play a bit with that library in order to understand how it work. ...
47 views

### SARIMAX model slopes downwards instead of upwards

I'm a complete beginner to time series forecasting, so I worry that some of my questions might be downright stupid, but here we go. My Code: I am trying to fit a SARIMAX model to predict CPRAVG while ...
32 views

### Unexpected fittedvalues using statsmodels SARIMAX [duplicate]

I have noticed that SARIMAX model in statsmodels does not produce the expected (correct) fittedvalues when the model is specified as an ARMA. Below is an example showing the discrepancy between what I ...
9 views

### Can I enter missing responses as a covariate in ANOVA when compare across groups?

I have a dataset collected from 3 groups of clinical samples. I want to compare measures among 3 groups but each group has substantial missing responses. What are the strategies for handling missing ...
73 views

34 views

### 'low limit of 30% confidence interval' is higher than 'forecasts' in arimax model

I ran the ARIMAX model for multi-step forecasts (steps=n). The code was written in python and I used the ARIMA model from statsmodels library. (https://www.statsmodels.org/stable/generated/statsmodels....
19 views

### Large negative intercept value in python statsmodels regression for a time-series [duplicate]

I am quite new to regression analysis and am using python's statsmodels. My dataset is a time-series, which consists of values of a variable recorded for a long ...
82 views

### Hyperparameter tuning of statsmodels quantile regression

I am working in statsmodels and I am trying to do linear quantile regression with the function QuantReg. I can however not figure out a way to tune any ...
96 views

### How to correct conditional Poisson standard errors for over-dispersion

I want to estimate a conditional negative binomial model, which an economist might call a negative binomial model with individual fixed effects. I use Python and statsmodels, which has a conditional ...
15 views

### How to set Ancova model for following data and hypotheses with attached dataset

How to set Ancova model for following data and hypotheses with attached dataset Data set :
156 views

### Python statsmodels, handling over-dispersion for Poisson Regression

I have a Poisson model (displayed below), where my $\epsilon_e$ term is designed to handle over-dispersion. I was curious if statsmodels has an easy way of returning a coefficient $\epsilon$ that fits ...
83 views

### Python statsmodels error when trying to use OLS to calculate price elasticity from sales history

I have some order data with the items included in it, the prices of each item, the brand, the customer and the date of the order that I am trying to use to calculate the price elasticity of the ...
163 views

### Calculating AIC & BIC

I have an output from two LMER-models and I'd like to calculate AIC & BIC. I believe I've understood the tables correctly, but I'm uncertain regarding the k parameter; have I understood it ...
112 views

### Python statsmodels. How to compared nested GLM , binomial family , with an anova test?

I'm trying to test if the addition of extra variables reduces the residuals variance and improves the model fit. Consider the below reproducible example: ...
13 views

### Repeated measure ANOVA with Zero for baseline

I have 20 patients and I'm measuring their blood drug level at different time with increasing doses recorded 3 times and compared with baseline which is zero for all. Can I use repeated measure ANOVA ...
68 views

### Interpretation of Group Var and visualizing LMER-model

I've fitted an LMER-model in Statsmodels, and I'd like to illustrate my results with a plot. My data consists of 14 groups, measured once daily during a timeperiod of 15 days (there are a few ...
48 views

### Computing condition number for OLS

In https://www.statsmodels.org/0.8.0/examples/notebooks/generated/ols.html, if you scroll down to the section "Multicollinearity" (bolded), it shows that the condition number of $X$ is \$4....
45 views

### Choleskly constraint in mlemodel in statsmodel

I want to constraint the off diagonal terms in the covariance matrix in a dynamic linear model. I tried using Cholesky method but it does not seem to converge. I am trying to fit a multivariate CAPM ...