Questions tagged [olsmultiplelinearregression]
29 questions
2
votes
0 answers
Wha is TSLM equivalent of R in python?
OLS in python does multiple linear regression without considering the timestamp. What is the equivalent of TSLM of R in Python, which takes timestamp into consideration.

Nitish Kumar
- 101
- 6
2
votes
1 answer
Visualizing multiple linear regression using R
I am trying to fit and visualize a multiple linear regression model using four variables.
fit <- lm(general_data$Bacterial.Contigs ~ general_data$Soil.Temperature + general_data$Time.point + general_data$Year)
Here, Time.point and Year are…

Atia Amin
- 379
- 1
- 4
- 10
1
vote
2 answers
linear regression/ols regression with python
I want to run multiple linear regression models, and there are 5 independent variables (2 of them are categorical).
Thus, I first applied onehotencoder to change categorical variables into dummies.
These are dependent and independent variables
y =…

Jleeca
- 29
- 3
1
vote
1 answer
Calculating difference of two means and its confidence interval
I have data of a protein "F" in patients who used or not used a drug "X".
I have 3 cofounders (age, BMI, sex) that I should adjust.
I successfully calculated the means of protein amount in the drug-group and no-drug group by using the below code:
>…

Angel
- 13
- 3
1
vote
1 answer
muliple linear regression, traing dataset graphs ,ValueError: x and y must be the same size
i am running following code, graph for training dataset is giving error,
import pandas as pd
import numpy as np
df = pd.read_csv('11.csv')
df.head()
AT V AP RH PE
0 8.34 40.77 1010.84 …

homaa
- 11
- 1
1
vote
0 answers
Developing Leverage Statistics by Hand
I currently have the below data frame df with the regression equation
regression_eq <- -0.09999975 * df$x + 1.999999 * df$y and am trying to determine the leverage points by hand. I have now reviewed many sources and am still stuck. I understand…

AW27
- 481
- 3
- 15
1
vote
0 answers
Implementing Multiple variable linear regression using Polynomialfeatures(degree = 1) and simple linear regression gives 2 different results
I am trying to code a multiple linear regression problem using two different methods. One is the simple one as stated below:
from sklearn.model_selection import train_test_split
X = df[['geo','age','v_age']]
y = df['freq']
X_train, X_test, y_train,…

Crossfit_Jesus
- 53
- 4
- 18
1
vote
1 answer
how to regress unemployment on minimum wage in r
I have two different data sets, one that has the annual unemployment rate by state (listed under a single column) and the second data set has the minimum wage for each state. Both have only have data between 2003-2020.
The problem is
They are in…

bandcar
- 649
- 4
- 11
1
vote
1 answer
Can I use numpy.polyfit(x, y, deg) for multiple linear regression
Is there any way I can fit two independent variables and one dependent variable in numpy.polyfit()?
I have a panda data frame that I loaded from a csv file.
I wish to include two columns as independent variables to run multiple linear regression…

jie xi lim
- 37
- 9
0
votes
0 answers
Multiple Linear Regression with time series data
Does anyone have a link that provides an explanation (+ if it includes an example I could learn from that would be great) on how to perform (multiple) linear regression with time series data using python please?
Thanks! Any help is much…

VXP
- 3
- 1
0
votes
0 answers
Receiving this Error "in if (is.na(s)) { : the condition has length > 1 " on R when using Stargazer for 6 multiple regressions
I am currently doing some panel data regressions in R and I am trying to put multiple models side-by-side using stargazer
When I put 5 panel data models using stargazer I receive an output
reglogglobal2 <- plm(log1p(GDP_growth) ~…

Progress_regress
- 1
- 1
0
votes
0 answers
Dummy variables in MLR models
I'm making a multiple linear regression using only dummy variables as predictors. What potential problem am I likely be introducing into the model by only using dummy varaibles as predictors? How could it affect my results?
I tried creating a sample…

LTW
- 1
0
votes
0 answers
Missingdataerror: exog contains inf or nan while trying to fit an OLS model
Trying to fit an OLS model but not successful.
2 responses were gotten as error:
missingdataerror: exog contains inf or nan
olsmodel1 not defined
Below is my code:
olsmodel1 =sm.OLS(y_train, x_train).fit()
print(olsmodel1.summary())
I have checked…

Foluso Alabi
- 1
- 1
0
votes
0 answers
Multiple regression Analysis with R
I am fitting a regression model in R with the data above but i want to know if the variables "year" ,"style" should be continuous or categoricalenter image description here

PalmA Ambrose
- 1
- 1
0
votes
1 answer
Repeated columns of a single variable when using statsmodels.formula.api package ols function in python
I am trying to perform multiple linear regression using the statsmodels.formula.api package in python and have listed the code that i have used to perform this regression below.
auto_1= pd.read_csv("Auto.csv")
formula = 'mpg ~ ' + " +…

dataqueries
- 11
- 2