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
1answer
32 views

Specifying Mixed Effects Model Formulas

I have a dataset of experiment groups, different tests, schools, and students (note students are in the dataset multiple times due to multiple tests so they're not iid either) and want to specify a ...
0
votes
1answer
16 views

How to correctly interpret a categorical by numeric interaction coefficient in a GLM

After moving from a proprietary GUI-based software to python for GLM development, I find I'm confused on interpreting the output of an interaction. Using the ...
0
votes
0answers
15 views

Compare sale to start inventory with simple normal proportions test

I have a dataset where I know how many units of each product I have in starting inventory. Then I know how many units of a given product were sold during a sale. I also know how many units of all ...
0
votes
0answers
21 views

How to perform multi-step forecasting in holt-winter modeling in python

I am trying to implement demand forecast of a produt for a month ahead and then convert it to week wise. I have received 7 years of week wise sales data,did all necesary data preprocessing,train(up to ...
0
votes
1answer
20 views

Statsmodel Ljung-Box test for non-zero mean

I have few time series, which I would like to model using ARIMA. But plotting ACF and PACF indicates these series are probably white noise. I am using Ljung-Box test to confirm it. I am implementing ...
0
votes
0answers
17 views

How to make StatsModels ARIMA more accurate?

I'm working on a big data project for my school project. My dataset looks like this: https://www.kaggle.com/umar47/usd-try I've translated column names to English to work smoothly. New column names ...
0
votes
0answers
24 views

Exogenous Values for stasmodels.forecast()

I am trying to forecast sales values using a SARIMAX model within the statsmodels package. As an endogenous input I am using a weekly history of values and I am leveraging the week-over-week percent, ...
0
votes
1answer
21 views

Exporting the UCM Model Prediction in CSV [closed]

My problem is extremely simple. But due to lack of proper documentation, I'm getting stuck. I'm using UCM from statsmodel of python. I'm trying this example. I want to create a dataset that has ...
1
vote
1answer
44 views

Recursive or direct forecasting used in forecast/predict() in stats models

I am working on a time series project. I have an hourly series and I have to forecast the 24 next hours. I am facing a problem with understanding how both the stats models forecast() and predict() ...
1
vote
1answer
28 views

How can I randomly draw a set of parameters from a regression given a model fit and covariance matrix?

I have built a GLM and have the fitted parameters and covariance matrix. I'd like to generate a set of random beta-parameters using the covariance matrix to estimate what the confidence bounds and ...
2
votes
1answer
105 views

Statsmodels Logistic Regression: Adding Intercept?

I'm relatively new to regression analysis in Python. I'm running a logistic regression on a dataset in a dataframe using the Statsmodels package. I've seen several examples, including the one ...
1
vote
0answers
18 views

Factor Analysis Cumulative Explained Variance Exceeding 100% when k-factors < p-variables [closed]

I'm new to Factor Analysis and having a rather frustrating result. I'm using the Factor Analysis implementation from statsmodels in Python with 119 variables and would like to reduce down to k-factors....
0
votes
0answers
18 views

Correlogram With Points Beyond -1 and +1?

I made a partial correlation plot of the residual of a dataset using python. I got the pacf graph below with some correlation points going to 2 and -1.5. Everyone finds this strange, does someone have ...
0
votes
1answer
31 views

How do I interpret the coefficients of a statsmodels multiple regression model with 2 dichotomous variables?

I have a continuous dependent variable Y and 2 dichotomous, crossed grouping factors forming 4 groups: A1, A2, B1, and B2. I am looking for the main effects of either factor, so I fit a linear model ...
0
votes
0answers
45 views

Time series Exponential smoothing by Holt winters method

I have basic questions with respect to exponential smoothing techniques, from statsmodels.tsa.holtwinters import ExponentialSmoothing add_model = ExponentialSmoothing(traindata,seasonal_periods=12 ,...
1
vote
1answer
77 views

I cannot understand formula for exogenous options in statsmodels' ARIMA

I need to use exogenous variables for my time series forecasting. And I found that I can include my exogenous variables into my ARIMA model using exogenous option. I want to know how this option ...
1
vote
0answers
55 views

Can I use ARIMA with hour data for two year prediction? [closed]

I am trying to use ARIMA model for time series forecasting. My data consists of hour by hour energy consumption. I have data for one year. So I have total 24*365 observations for energy consumption. ...
0
votes
1answer
47 views

Explain statsmodels's detrend function

Can someone help me to understand what is the detrend function from python's statsmodels? Or provide some reference to this method? Especially when set order= 1, 2, ... to 5. I have pasted the source ...
0
votes
0answers
24 views

z-test in statsmodel with known variance/std

To my knowledge: If I have a small Gaussian distributed data set and I know the true variance $\sigma$ of the data then the z-test is only appropriate if the standard deviation of the estimator is set ...
2
votes
1answer
59 views

Interpreting the intercept of a Linear Mixed Model Results in Python - Statsmodel Package

Using python package statsmodel and the code in this link: If a linear mixed model has a random variable with x groups. then why when one would run this code: ...
1
vote
1answer
80 views

python statsmodels extract equation ARIMAX [closed]

This is a model summary with two exogenous variables and AR of lag order 2, how to extract the equation out of this like Y= coff1* L1+ ....
1
vote
1answer
40 views

AR model throws ValueError on a constant time series

Here's my code: ...
0
votes
0answers
30 views

statsmodels OLS t test calculation issue

I notice statsmodels's OLS have different t value to a plain econometrics OLS. Below is an example: ...
1
vote
0answers
28 views

statsmodel package grangercausalitytests output explanation?

Was told to post her from stack overflow. I'm currently doing a project where I'm trying to find evidence of causality between human activity and global warming. I've been trying to run a granger ...
0
votes
0answers
28 views

How to estimate conditional CDF using python StatsModels

I am using statsmodels '0.10.1' to obtain conditional CDF of a 2 variable problem. ...
1
vote
1answer
33 views

In a large extended family somehow only my sister was born in October. What are the odds of that?

The are 45 people in my extended family. Only my sister was born in October. What are the odds of that occuring?
0
votes
0answers
25 views

Confidence interval for effect size includes zero but significant?

Hi everyone (first time user here), I am working on a paper and I am quite familiar with regression methods, but I am stuck... we have generated an effect size. Our beta is the largest in the model ...
0
votes
1answer
41 views

Granger Test interpretation

I am complete novice so bear with me. As per the documentation on statsmodels, the NULL hypothesis is that the second time series X2 does NOT granger cause X1. ...
0
votes
1answer
48 views

How Statsmodels predict ma process

I'm trying to get the prediction of ma process using model parameters. MA(1) process is: $$X_t = \Theta \omega_{t-1} + \omega_t$$ Hence the prediction might behave like$$X_t = \Theta \omega_{t-1}$$ ...
0
votes
0answers
18 views

Why does a trended series and a random series give low p values on ADF test?

Why do the following two series both produce p-values below 0.05, given that one is trending and the other not? What does this test really mean given this? ...
1
vote
1answer
54 views

Statsmodel ADF interpretation

I'm regressing two time-series against one another, and I'm struggling with how to interpret an ADF test: does a low value indicate that a series, once detrended, would be stationary; or does it show ...
3
votes
2answers
145 views

Heteroscedasticity in Linear Regression

I implemented a linear regression model on some dataset. When I plotted the scatter plot of residual v/s predicted y (i.e., yhat), I observed heteroscedasticity in the plot. What can I do about it? x-...
0
votes
1answer
96 views

does statsmodels support multi-level modeling for classifiers [closed]

I have searched and searched the statsmodels documentation for a useable multilevel classifier but have not found any at all. sklearn also provides no support for hiearchical classification models. Is ...
0
votes
1answer
52 views

bootstrapping mixed effect regression coefficients in statsmodels

I have a mixed effect model that looks like this: ...
0
votes
0answers
55 views

Interpreting the Granger Causality Test

I am trying to go through an online time series analysis tutorial and they use the Granger Causality Test to see if there is some benefit to jointly model two time ...
1
vote
0answers
38 views

Varying Coefficient model conditioned on a coded and continuous variable [closed]

Hello I am trying to accomplish the following: I have a hypothesis that a simple linear model ($Y = \beta_{0} + \beta_{1}X + \varepsilon$) is insufficient to capture some dynamics of the ...
0
votes
1answer
57 views

Generating synthetic data based on mean, skewness, standard deviation and autocorrelation

Given that I have the mean, standard deviation, skewness and autocorrelation, How do I generate 1000 years of random data based on the above parameters in python or Matlab? I know for example I can ...
1
vote
1answer
27 views

How can I compute the standard error and confidence intervals for the base level on a variable?

I'm running a GLM with a tweedie, log-link function. That said, I have a categorical variable that transformed to dummy variables leaving off one of those variables when I modeled. Now that I'm ...
4
votes
2answers
190 views

Gamma GLM - Derive prediction intervals for new x_i

In a Gamma GLM, the statistical model for each observation 𝑖 is assumed to be $Y_i \sim Gamma(shape, scale)$, where $E(Y_i) = \mu_i = f(X_i\beta)$, and $f$ is the link function. I've used MLE to ...
2
votes
2answers
357 views

Anyone know Multivariate OLS on Statsmodels? [closed]

I trying to run a mutivariate multiple regression using Statsmodels. Not sure if this is the best tool for this type of regression, so please do tell me if there's another package to which I should ...
0
votes
0answers
25 views

R power.prop.test for two samples with different proportions

I am trying to modify power.prop.test is R to adapt for cases where n1 and n2 (two sample sizes) are not equal. That is, they can not be given by one constant n. The equation in R for n1 = n2 = n ...
0
votes
0answers
16 views

How to perform MANOVA with categorical independent variables

I have a dataset where the independent variable is sieve size (categorically either 25, 63, 100 or 150), and the dependent variables are length and width. ...
0
votes
0answers
22 views

Fitting data to a distribution that appears lognormal without right-hump

I will like to fit a distribution and extract its moments in Python, given Length of Stay (LOS) data in hospitals. Asking out of curiosity, suppose the plot of the data looks like: The reason why I ...
0
votes
1answer
86 views

Why final Chi Square value is too large while fitting goodness of fit for Poisson distribution? [closed]

I have mean level spacing as input data. With this data I plot histogram using 10 bins. x ranges from 0 to 9 because bins are 10, f is the bin counts(means how many values in each bin). Then I ...
0
votes
1answer
51 views

Coffee ratings: How to do causal inference with high kurtosis/outliers?

I have data (n>1000) on ratings of various coffee features, and then a final overall score. I am interested in inference: What is the effect of a feature on overall score. However, my data has ...
0
votes
0answers
24 views

How to read summary of statsmodels statespace fit?

I am trying to understand the summary information provided in the statsmodels statespace API, such as is illustrated in this code. Below I have a screenshot of the summary information provided. I am ...
0
votes
0answers
48 views

Statsmodel GenericLikelihoodModel - subclass Normal distribution

I'd like to use stats model GenericLikelihoodModel to fit a normal distribution. The doc gives an example with a probit distribution: https://www.statsmodels.org/dev/examples/notebooks/generated/...
0
votes
2answers
66 views

ARIMA Minute Data and Holidays

I have a minutely dataset for a year duration. It has a daily seasonality. This would imply a seasonal period of 1440 according to https://robjhyndman.com/hyndsight/seasonal-periods/ . I thought of ...
0
votes
0answers
198 views

What is coint ouput in statsmodels.tsa.stattools.coint?

I am trying to understand how to apply cointegration. I got the intution behind cointegration but can't understand what coint output value means or how to use it? I ...
0
votes
1answer
206 views

Am I using the right linear mixed model design for my data?

I want to move from using repeat measure ANOVAs to linear mixed models (LMM). However, where I have good intuitions about ANOVAs, LMMs are new to me. I'm using python's StatsModels as my package. Here'...