Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
20 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 ...
0
votes
0answers
20 views

how to merge two different time series in pandas (with different variables) [closed]

How can I normalize mulitvariate timeseries categorical data for use with ARIMA models like varmax? This question is not about the programmatic means of data wrangling, but rather about what exactly ...
1
vote
1answer
15 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
30 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: ...
3
votes
1answer
32 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
40 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
28 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
34 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
12 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
37 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
20 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
79 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 ...
6
votes
1answer
118 views

The identity link function does not respect the domain of the Gamma family?

I am using using a gamma generalized linear model (GLM) with an identity link. The independent variable is the compensation of a particular group. Python's statsmodels summary is giving me a warning ...
0
votes
0answers
21 views

Help me interpret a few lines of code and their results? (correlation analysis / CCA / Validation)

I have a few lines of code, using an R package to explore canonical correlation between two datasets. I really cannot make sense of the results, even if I read the documentation or academic articles ...
0
votes
0answers
47 views

ADF test and seasonal series

Hi I'm new in the time series field and so I've different doubts. Considering this dataset https://archive.ics.uci.edu/ml/datasets/Individual+household+electric+power+consumption And considering ...
1
vote
2answers
51 views

Nonlinear regressor in GLM link function

Try to reproduce Robert E. McCulloch and Ruey S. Tsay’s paper Nonlinearity in High-Frequency Financial Data and Hierarchical Models with local market data. the paper uses GLM to model high-frequency ...
0
votes
0answers
81 views

Discussion of a parameter in the python statsmodels augmented Dickey Fuller test

I would like to use the adfuller test from statsmodels.tsa.stattools, but I'm not sure when to change the parameter ...
1
vote
0answers
31 views

How to make statsmodels treat timeseries values as continuous? [closed]

This is basically a copy of the stackoverflow question here, which never received an adequate answer. The problem is that the Python's statsmodels package insists ...
1
vote
0answers
21 views

Which model for testing “has this binary variable changed over time?”

I am trying to figure out if a list of historical documents (N=50) drifted from one value of a binary variable $w$ to the other. Users have given 1 to 5 votes whether they think they think the ...
3
votes
2answers
219 views

Why is gradient descent so bad at optimizing polynomial regression?

As part of a self-study exercise, I am comparing various implementations of polynomial regression: Closed form solution Gradient descent with Numpy Scipy optimize Sklearn Statsmodel When the ...
1
vote
2answers
88 views
1
vote
1answer
101 views

Interpretation of PACF and ACF plots [duplicate]

I am trying to fit an ARMA model to a time series of a power spectral density values that I have calculated. Here is the plot of the data: with corresponding autocorrelation and partial ...
0
votes
0answers
92 views

Convergence Warning while Determining the order of ARMA model using arma_order_select_ic

I have got around 150 companies returns' data and I am trying to determine the arma order of p and q for each company. I came across the arma_order_select_ic function in the statsmodel library and ...
0
votes
1answer
36 views

Can log-likelihood of the data decrease when adding parameters in a linear mixed model?

I'm trying to fit different linear mixed models in the context of model selection. I'm using the StatsModel Python package in order to do that. However, I encounter a very strange phenomenon. Say I ...
2
votes
0answers
343 views

Ljung-Box test p-values

I am using the Ljung-Box test from the python statsmodel package to test if there are autocorrelations in a time series. To make sure I understand the test, I am performing it on white noise and ...
2
votes
1answer
28 views

model building - regression in statistical analysis

I have a theoretical question regarding model building. I have some real empirical data, but I will present the problem in more general terms. I have two groups. I have a dependent variable, and an ...
1
vote
2answers
215 views

Mixed Effects Model with Pre-Post Dependent Variable

I have a dataset that most likely requires a mixed effects model, but which has a few quirks that make me want to confirm that my current modeling approach is correct. Background My DV is a ...
0
votes
2answers
612 views

statsmodels SARIMAX forecast has downward slope

I fit a statsmodels.tsa.statespace.sarimax.SARIMAX model (statsmodels==0.8.0) but I'm getting unexpected forecasting behavior, ...
0
votes
0answers
220 views

Running a Logistic regression - overflow error [duplicate]

I am running a logit regression and the "field1" is an existing list of 1's and 0's (which I am converting into a numpy list before passing as a parameter to Logit). I am trying to come up with a ...
0
votes
1answer
72 views

Possibility of performming Timeseries Modeling and forecasting on per second (high frequency data)

I want to perform an analysis on timeseries data which is measured per second. To give some context, it is a data of temperature of air at the exit of air heater. Fluctuations in data are either due ...
0
votes
0answers
207 views

Interpret regression model actual vs predicted plot far off of y=x line

I'm working in Python with statsmodels. I estimate an OLS multiple regression model (n=10763; 12 predictors; r^2=0.29) The model coefficients all have signs pointing the correct theoretical direction ...
1
vote
1answer
120 views

Why does matrix condition number change drastically when a constant is added?

If I create a regression model design matrix with 3 uncorrelated variables, I get a small condition number as expected. MWE: ...
0
votes
2answers
208 views

Regression model constant causes multicollinearity warning, but not in standardized model

I'm working in Python with statsmodels. I have a response variable y and a design matrix X from which I have already removed the ...
0
votes
1answer
323 views

Difference in R-squared observed from statsmodels when WLS is used

Recently I have been trying to solve one of my problems with OLS and WLS respectively, and was trying to determine whether a weighted regression would be more suitable by comparing the R^2 value. I ...
0
votes
0answers
14 views

Minimum how many variables required for running GzLM or GAM?

I am interested to find, out of 3 different traps (Treatment), which trap catching more insects (Responder). Data is not normally distributed and overdispersed. Here is my data; ...
2
votes
0answers
1k views

Assessing A/B test results using Python

Problem's setting Assume having results of an A/B test. You let you users experience two variants of your website and you counted how many converted: ...
1
vote
2answers
2k views

Standard error of regression and of predictions in python (these are available in R) [closed]

I'm working with R and confirming my results in Python with the overwhelming majority of the work matching between the two quite well. There are two outputs coming out of R that I'm not seeing how to ...
0
votes
0answers
555 views

python StatsModels use training parameters for test data summary

I ran a linear regression on a month of hourly Nox concentration using StatsModels ols function. how can I get summary OLS Regression Results on the test data? I ...
0
votes
0answers
29 views

Conditional density distribution, two discrete variables

I have plotted the conditional density distribution of my variables by using cdplot. My independent variable and my dependent variable are not independent. Independent variable is discrete (it takes ...
0
votes
0answers
14 views

Analysis of power after filtering but before calculating t-statistic

Suppose I want to calculate many t-statistics from some arrays of data. The length n of these arrays changes depending on a filtering step I perform previously. ...
0
votes
0answers
284 views

How to report results of a polynomial regression with a discrete independent variable

I have been recently trying to fit a linear model to my data. The dependent variable is continuous and the independent variable is numeric and discrete. When I first test the assumptions concerning ...
0
votes
0answers
32 views

negation of AR params in statsmodels

In this documentation there is a mention that "due to the conventions used in signal processing used in signal.lfilter vs. conventions in statistics for ARMA processes, the AR paramters should have ...
2
votes
1answer
186 views
2
votes
0answers
108 views

Sampling a statsmodel KDEMultivariate

I have been exploring kernel density methods in statsmodel that allow categorical variables but it seems that, unlike scikit learn kernel density implementation, there are no methods to generate ...
0
votes
0answers
263 views

OLS regression using the CAPM model in python

I've checked several posts here and haven't found what I'm looking for... The goal is to do a CAPM regression and assume that you have the following information: monthly prices for company AAPL, S&...
0
votes
0answers
190 views

Dynamic factor in statsmodels

I'm trying to use dynamic factor in statsmodels to estimate a model as following: $y_{1,t} = \alpha_1 f_t + N(0, \epsilon_1)\\ y_{2,t} = \alpha_2 f_{t-h} + N(0, \epsilon_2)\qquad h \text{ is unknown}...
1
vote
1answer
268 views

In the ARMA model from the Python statsmodel library, what does the second order parameter represent?

I know ARMA is a combination of two models: The autoregressive model (AR) & moving average model (MA). Both models take up an order parameters which determines how many past data points will be ...
0
votes
0answers
141 views

Do you HAVE TO base Granger causality tests based on a time series model or can do the tests as standalone?

I would like to test a large number of economic time series for causal relationships on one another, on an exploratory, data-driven basis (as apposed to theory-driven). Very often, wherever I have ...
2
votes
1answer
60 views

How can I program correction for multiple comparisons using lsmeans in R while not correcting for more than necessary

I posted this question on stack overflow here enter link description here but did not get useful feedback. So, I'll post it again here, in the hopes that this is a better venue for it. I'm wondering ...