linear-regression Questions
1
I have been trying to do stepwise selection on my variables with R. This is my code:
library(lattice)#to get the matrix plot, assuming this package is already installed
library(ftsa) #to get the o...
Verjuice asked 18/4, 2015 at 18:11
9
I use scikit linear regression and if I change the order of the features, the coef are still printed in the same order, hence I would like to know the mapping of the feature with the coeff.
#traini...
Octans asked 7/1, 2016 at 7:58
5
I am performing multiple regressions on different columns in a query file. I've been tasked with extracting certain results from the regression function lm in R.
So far I have,
> reg <- lm(...
Below asked 22/7, 2015 at 17:50
4
Solved
I am trying to tweak contrast coding on a linear model where I want to know if each level of a factor is significantly different from the grand mean.
Let’s say the factor has levels "A", ...
Epigraph asked 30/6, 2022 at 18:6
4
Solved
I am mastering pytorch here, and decided to implement very simple 1 to 1 linear regression, from height to weight.
Got dataset: https://www.kaggle.com/datasets/mustafaali96/weight-height but any ot...
Waggon asked 19/12, 2022 at 14:50
2
Solved
What does it mean when we put a colon : between two characters? I'm sure it's not saying from character A to character B.
Here is the code:
fit9=lm(Sales~.+Income:Advertising+Price:Age,data=Cars...
Methodius asked 24/3, 2017 at 11:16
3
Solved
I have a dataset including categorical variables(binary) and continuous variables. I'm trying to apply a linear regression model for predicting a continuous variable. Can someone please let me know...
Gaia asked 22/6, 2017 at 8:33
2
How can I clip the values returned by the Lambda layer?
I tried using this:
from keras.backend.tensorflow_backend import clip
from keras.layers.core import Lambda
...
model.add(Dense(1))
model.a...
Testis asked 29/3, 2017 at 16:32
1
Solved
I want to get a confidence interval of the result of a linear regression. I'm working with the boston house price dataset.
I've found this question:
How to calculate the 99% confidence interval for...
Lambeth asked 18/4, 2020 at 16:22
2
Solved
I've been attempting to fit this data by a Linear Regression, following a tutorial on bigdataexaminer. Everything was working fine up until this point. I imported LinearRegression from sklearn, and...
Alanalana asked 28/7, 2016 at 20:22
3
Solved
I am trying to plot a Linear Regression onto a scatterplot in Python.
In R I would simply do the following:
Run OLS Linear Regresion
fit_1 <- lm(medv ~ lstat)
plot(medv ~ lstat)
abline(fit_1, co...
Edmea asked 8/2, 2018 at 9:52
1
Solved
I am using Stargazer to output a regression table with multiple lm models together. The problem is that Stargazer outputs the F-Statistic and degrees of freedom in a single line by default. If you ...
Daren asked 18/9, 2020 at 16:1
6
Solved
I want to predict a value at a date in the future with simple linear regression, but I can't due to the date format.
This is the dataframe I have:
data_df =
date value
2016-01-15 1555
2016-01-...
Minimus asked 24/10, 2016 at 11:35
10
Solved
I wonder how to add regression line equation and R^2 on the ggplot. My code is:
library(ggplot2)
df <- data.frame(x = c(1:100))
df$y <- 2 + 3 * df$x + rnorm(100, sd = 40)
p <- ggplot(dat...
Selfstarter asked 26/9, 2011 at 0:52
1
Suppose we want to do a simple 'descriptive model of income.' Suppose we have three groups, North, Central, and South (think US regions).
Comparing otherwise similar groups, suppose average income ...
Midmost asked 11/5, 2021 at 22:57
6
Solved
I'm trying hard to add a regression line on a ggplot. I first tried with abline but I didn't manage to make it work. Then I tried this...
data = data.frame(x.plot=rep(seq(1,5),10),y.plot=rnorm(50)...
Cyclostyle asked 26/3, 2013 at 9:40
5
Solved
result = sm.OLS(gold_lookback, silver_lookback ).fit()
After I get the result, how can I get the coefficient and the constant?
In other words, if
y = ax + c
how to get the values a and c?
Totem asked 20/11, 2017 at 9:1
2
Solved
I performed a regression analyses in R on some dataset and try to predict the contribution of each individual independent variable on the dependent variable for each row in the dataset.
So somethi...
Finzer asked 17/12, 2017 at 9:35
6
Solved
Here is what I am doing:
$ python
Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>>> import statsmodels.api as sm
>>...
Eurypterid asked 20/12, 2013 at 10:27
8
Solved
I'm trying to generate a linear regression on a scatter plot I have generated, however my data is in list format, and all of the examples I can find of using polyfit require using arange. arange do...
Kelliekellina asked 27/5, 2011 at 5:32
5
Solved
I know there is a small difference between $sigma and the concept of root mean squared error. So, i am wondering what is the easiest way to obtain RMSE out of lm function in R?
res<-lm(randomDa...
Experiment asked 30/3, 2017 at 16:27
3
I have months(Jan, Feb, Mar etc) data in my dataset and I am generating dummy variable using pandas library.
pd.get_dummies(df['month'],drop_first=True)
I want to understand whether I should use dr...
Wellchosen asked 30/8, 2020 at 19:17
3
Solved
If we want to search for the optimal parameters theta for a linear regression model by using the normal equation with:
theta = inv(X^T * X) * X^T * y
one step is to calculate inv(X^T*X). Therefor...
Blinkers asked 19/3, 2018 at 7:4
3
The OLSResults of
df2 = pd.read_csv("MultipleRegression.csv")
X = df2[['Distance', 'CarrierNum', 'Day', 'DayOfBooking']]
Y = df2['Price']
X = add_constant(X)
fit = sm.OLS(Y, X).fit()
print(fit.sum...
Concessionaire asked 10/12, 2016 at 11:38
2
Solved
What is this error and what do I do to fix it? I cannot change my data.
X = train[['id', 'listing_type', 'floor', 'latitude', 'longitude',
'beds', 'baths','total_rooms','square_feet','grou...
Punjabi asked 25/6, 2018 at 21:3
© 2022 - 2024 — McMap. All rights reserved.