linear-regression Questions
3
Solved
Let us say I want to run the linear regression model on the mtcars dataset several times on different samples.
The idea is, for each iteration in a for loop, to store the results of the predict() m...
Owensby asked 19/7, 2018 at 18:3
1
Solved
I have a logistic regression model in R, where all of the predictor variables are categorical rather than continuous (in addition to the response variable, which is also obviously categorical/binar...
Degenerate asked 18/7, 2018 at 18:40
1
Solved
I have a data set that investigate depression among individuals with different ethnicities (Black, White, and Latina).
I want to know how depression at baseline relates to depression at post with ...
Nasser asked 18/7, 2018 at 17:37
1
Solved
I am trying to learn a bit about different types of regression and I am hacking my way through the code sample below.
library(magrittr)
library(dplyr)
# Polynomial degree 1
df=read.csv("C:\\path...
Looselimbed asked 9/7, 2018 at 15:42
1
I have a DataFrame as follows:
Ticker
Date
Close
0
ADBE
2016-02-16
78.88
1
ADBE
2016-02-17
81.85
2
ADBE
2016-02-18
80.53
3
ADBE
2016-02-19
80.87
4
ADBE
2016-02-22
83.80
5
ADBE
20...
Chinch asked 6/11, 2016 at 19:44
3
Solved
Given the following data frame:
structure(list(`-5` = c(0, 1, 0, 0, 9, 22), `-4` = c(1, 3, 0,
0, 1, 17), `-3` = c(1, 3, 0, 0, 0, 12), `-2` = c(1, 3, 0, 0,
2, 10), `-1` = c(0, 0, 0, 4, 3, 9), `0`...
During asked 4/7, 2018 at 19:58
2
I have an issue finding the most efficient way to calculate a rolling linear regression over a xts object with multiple columns. I have searched and read several previously questions here on stacko...
Foliolate asked 8/8, 2012 at 21:2
3
When we have a linear model with a factor variable X (with levels A, B, and C)
y ~ factor(X) + Var2 + Var3
The result shows the estimate XB and XC which is differences B - A and C - A. (suppose...
Orel asked 19/10, 2016 at 23:58
1
Solved
I would like to perform Deming regression (or any equivalent of a regression method with uncertainties in both X and Y variables, such as York regression).
In my application, I have a very good sci...
Rodas asked 12/6, 2018 at 13:34
3
Solved
I need to explain this in excruciating detail because I don't have the basics of statistics to explain in a more succinct way. Asking here in SO because I am looking for a python solution, but migh...
Lewendal asked 24/8, 2012 at 8:8
6
Solved
I'm trying to write out a bit of code for the gradient descent algorithm explained in the Stanford Machine Learning lecture (lecture 2 at around 25:00). Below is the implementation I used at first,...
Janerich asked 16/10, 2011 at 8:45
1
Solved
I would like to use group_by %>% do(tidy(*)) to run several linear regression models and to extract model results to the data frame. The data frame should include the following for each model: o...
Coverley asked 17/5, 2018 at 11:41
10
Solved
I want to do a linear regression in R using the lm() function. My data is an annual time series with one field for year (22 years) and another for state (50 states). I want to fit a regression for ...
Intestinal asked 23/7, 2009 at 4:0
4
Solved
I have question regarding the lm() function in R.
I understand that lm() is used for regression modeling and I know that one can do this:
lm(response ~ explanatory1 + explanatory2 + ... + explanat...
Faunie asked 19/4, 2018 at 22:17
1
Solved
I'm looking to find the distance between the points and the prediction line. Ideally I would like the results to be displayed in a new column which contains the distance, called 'Distance'.
My Imp...
Apsis asked 16/4, 2018 at 14:21
1
Solved
I am doing multivariate regression with a fully connected multilayer neural network in Tensorflow. The network predicts 2 continuous float variables (y1,y2) given an input vector (x1,x2,...xN), i.e...
Aphanite asked 17/7, 2016 at 22:41
2
Solved
Using the segmented package to create a piecewise linear regression I am seeing an error when I try to set my own breakpoints; it seems only when I try to set more than two.
(EDIT) Here is the cod...
Surmise asked 27/8, 2012 at 1:42
6
Solved
Does anyone know of an efficient way to do multiple linear regression in C#, where the number of simultaneous equations may be in the 1000's (with 3 or 4 different inputs). After reading this artic...
Ceilometer asked 26/5, 2010 at 5:50
1
Accidentally I have noticed, that OLS models implemented by sklearn and statsmodels yield different values of R^2 when not fitting intercept. Otherwise they seems to work fine. The following code y...
Signpost asked 16/2, 2018 at 18:35
4
data = pd.read_excel("/Users/madhavthaker/Downloads/Reduced_Car_Data.xlsx")
train = np.random.rand(len(data)) < 0.8
data_train = data[train]
data_test = data[~train]
x_train = data_train.ix[...
Sneak asked 28/3, 2017 at 23:0
3
Solved
I have a dataset that contains 510 samples for training and 127 samples for testing, each sample has 7680 features. I want to design a model to predict the height (cm)-label-from the training data....
Unctuous asked 4/3, 2018 at 10:11
3
I am wondering if there is a better way to test if two variables are cointegrated than the following method:
import numpy as np
import statsmodels.api as sm
import statsmodels.tsa.stattools as ts
...
Ado asked 6/7, 2012 at 13:16
2
Solved
I'm looking to check trends for a number of entities (SysNr)
I have data spanning 3 years (2014,2015,2016)
I'm looking at a large quantity of variables, but will limit this question to one ('res_...
Lobbyist asked 13/2, 2018 at 13:29
2
Suppose I want to compute the least squares coefficients in TensorFlow using the closed form solution. Normally, I would do this like so,
beta_hat = tf.matmul(
tf.matmul(tf.matrix_inverse(tf.matm...
Shick asked 22/11, 2015 at 18:54
4
I am using LaasoCV from sklearn to select the best model is selected by cross-validation. I found that the cross validation gives different result if I use sklearn or matlab statistical toolbox.
I...
Diagnostician asked 5/10, 2012 at 12:40
© 2022 - 2024 — McMap. All rights reserved.