statsmodels

How to get Effect Size from tt_ind_solve_power?

How to get Effect Size from tt_ind_solve_power? Question: I am trying to get the Effect Size given my alpha, power, sample size, ratio. I found tt_ind_solve_power to do this but how would this work for 4 variants + 1 control? This is how I have it currently from statsmodels.stats.power import tt_ind_solve_power effect_size = tt_ind_solve_power(nobs1=X, alpha=0.05, …

Total answers: 1

ARIMA summary showing as SARIMAX

ARIMA summary showing as SARIMAX Question: I have an ARIMA(1,1,1) model I am trying to fit to a dataframe of stock prices. The index of the dataframe is a date. The code below compiles but it produces a SARIMAX summary and not ARIMA (see image). from statsmodels.tsa.arima.model import ARIMA dataset_for_prediction.index = dataset_for_prediction.index.to_period(‘B’) model = ARIMA(dataset_for_prediction[‘Adj …

Total answers: 1

How to create Predicted vs. Actual plot using abline_plot and statsmodels

How to create Predicted vs. Actual plot using abline_plot and statsmodels Question: I am trying to recreate this plot from this website in Python instead of R: Background I have a dataframe called boston (the popular educational boston housing dataset). I created a multiple linear regression model with some variables with statsmodels api below. Everything …

Total answers: 1

Which Seasonal Adjustment Program should I use with Statsmodels X-13-ARIMA

Which Seasonal Adjustment Program should I use with Statsmodels X-13-ARIMA Question: I have downloaded Win X-13 from Census, and unpacked it on my drive. My code looks like this: import pandas as pd from pandas import Timestamp import os import statsmodels.api as sm s = pd.Series( {Timestamp(‘2013-03-01 00:00:00’): 838.2, Timestamp(‘2013-04-01 00:00:00’): 865.17, Timestamp(‘2013-05-01 00:00:00’): 763.0, …

Total answers: 1

Rolling Regression in Python

Rolling Regression in Python Question: I am trying to implement a Rolling Regression in Python and failed to do so using the statsmodels ‘MovingOLS’. In my data frame, the ‘Year’ column specifies the year of the respective observation. Now, I want to regress ‘F1_Earnings’ on ‘Earnings’ and ‘WC’ with a rolling 2-year-window, such that the …

Total answers: 1

Fourier series columns don't appear in Deterministicprocess()

Fourier series columns don't appear in Deterministicprocess() Question: I have been refreshing my time-series skills and I’m having trouble with creating Fourier series. Here is the data (if you run everything together it will give you the same plots and final table): import pandas as pd import matplotlib.pyplot as plt from statsmodels.tsa.deterministic import CalendarFourier, DeterministicProcess …

Total answers: 2

Improve scikit-learn Logistic Regression model vs Statsmodels – significant variables

Improve scikit-learn Logistic Regression model vs Statsmodels – significant variables Question: I’m working on an binary classification prediction and using a Logistic Regression. I know with statsmodels, it is possible to know the significant variables thanks to the p-value and remove the no significant ones to have a more performant model. import statsmodels.api as sm …

Total answers: 1

'ARIMAResults' object has no attribute 'plot_predict' error

'ARIMAResults' object has no attribute 'plot_predict' error Question: In stats models I have this code from statsmodels.tsa.arima.model import ARIMA from statsmodels.graphics.tsaplots import plot_predict df1.drop(df1.columns.difference([‘PTS’]), 1, inplace=True) model = ARIMA(df1.PTS, order=(0, 15,0)) res = model.fit() res.plot_predict(start=’2021-10-19′, end=’2022-04-05′) plt.show() However when it goes to plt.show I get the ARIMA results object has no attribute plot predict. What …

Total answers: 1

How to take confidence interval of statsmodels.tsa.holtwinters-ExponentialSmoothing Models in python?

How to take confidence interval of statsmodels.tsa.holtwinters-ExponentialSmoothing Models in python? Question: I did time series forecasting analysis with ExponentialSmoothing in python. I used statsmodels.tsa.holtwinters. model = ExponentialSmoothing(df, seasonal=’mul’, seasonal_periods=12).fit() pred = model.predict(start=df.index[0], end=122) plt.plot(df_fc.index, df_fc, label=’Train’) plt.plot(pred.index, pred, label=’Holt-Winters’) plt.legend(loc=’best’) I want to take confidence interval of the model result. But I couldn’t find any …

Total answers: 4