Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [linear]

For statistical topics which involve the assumption of linearity, for example, linear regression or linear mixed models, or for the discussion of linear algebra as applied to statistics.

1
vote
0answers
21 views

Endogeneity and Consistency

So I learned about the endogeneity problem of linear regression in class today, where E[XU] and Cov[X,U] isn't equal to zero but some random constant c times a standard basis k-element vector with 1 ...
0
votes
0answers
34 views

Goodness of Fit in linear regression - to me this is not a [duplicate]

The link that is supposed to answer my question neither mentions $R^{2}$ nor GoF. At least I do not see it. What is the name and the formula to calculate the GoF in that link? Both should exist for a ...
0
votes
0answers
37 views

Estimating errors in a least square linear regression

Suppose I have a linear model of the form: $$\mathbb A \mathbf x = \mathbf y$$ where $\mathbf x\in\mathbb R^p$ is a vector of parameters, $\mathbb A\in\mathbb R^{n\times p}$ a known matrix, and $\...
1
vote
1answer
50 views

Can Logistic regression be used as a Linear Regression model [closed]

In a question I'm given Construct a linear model and see how well the fat content can be estimated. That is, estimate the generalization error with a linear model. Optimize the number of ...
0
votes
0answers
18 views

Nonlinear data to use in multiple linear regression?

I am supposed to be running a multiple linear regressions to test my hypotheses. However, when first testing the assumptions that should be met before performing a linear regression, it turns out my ...
0
votes
0answers
20 views

interpretation of coefficients of independent variables in fractions

I am a bachelor student finishing my thesis and desperately need some help with the interpretation of regression coefficients. I am currently quite confused and my deadline is three days away. I have ...
0
votes
0answers
13 views

Need clarification for different notations and corresponding formulas in Linear Regression

1) First of all, can anybody clarify, whether my notations correspond to the correct formula. As I found different descriptions/notations for different formulas, I tried to put these Information ...
0
votes
0answers
15 views

Does low predicted variable significance indicate a model problem?

Suppose I am trying to construct a temporal model of some variable of interest. Suppose I have the following situation, where voi is a variable of interest, t is time, and x is some other variable: <...
0
votes
0answers
4 views

Group Minimum in Linear Regression

Let's say for each individual $i$ I have some dependent variable $y_i$ (for example income) and the independent variables $x_i$ and $z_i$ (age and academic degree). $z_i$ is a categorial variable and ...
0
votes
0answers
16 views

Best Linear Predictor for LMM Example

I have been attempting to work through a best linear predictor example within the textbook Semiparametric Regression by Ruppert, Wand, and Carrol (pdf). The specific example concerns a linear mixed ...
0
votes
1answer
51 views

Multiple Linear Regression - p value equal to NA

I have the problem that my p-value is always NA. I am making a Multiple Linear Regression in R. I have panel data for the period 2008-2018. One dependent variable (y) and 16 independent variables (x1-...
0
votes
0answers
12 views

Texreg equivalent for creating formatted output for Linear Hypothesis Test

I am currently using htmlreg as part of the texreg package to generate output of well-formatted linear output to use for presentation purposes. Does anybody know if there is an equivalent package/...
0
votes
1answer
49 views

Verifying Identification Results for Univariate Regression

So I have this linear regression model shown below and I'm supposed to be showing that equation 3 is equal to equation 4. There's a hint that says a 2x2 inverse matrix appears in the proof, but the ...
2
votes
0answers
21 views

Normally distributed shift in the independent variable

An online game has a system where players can "curse" each other for bad behavior. The game developer graphs "total hours played v. number of curses" and takes a linear regression. The trend line has ...
-1
votes
2answers
51 views

Linear regression and multicollinearity

There is a multiple linear regression model being created. Y=ax1+bx2+cx3 Following HYPOTHESES are formed Variable x does not impact y for all variables x1, x2 , x3 and so on. We removed a ...
1
vote
1answer
67 views

Repeated measures regression in R?

I am looking for a way to perform linear regression in R. So far I have done a lot of regression analyses, but never with repeated measures. My dataset has the following variables: DV - the ...
1
vote
1answer
29 views

Validity of the linearity assumption

I have to research unaided recall of commercials given a set of variables. So, I formulated the following model: $unaided = \beta_0 + \beta_1duration + \beta_2blocksize + \beta_3position + \beta_4 ...
0
votes
0answers
15 views

Is ATE = 1/2 ATT + 1/2 ATC?

Is this statement true or false? Please provide justification. The following identity generally holds: ATE = 1/2 ATT + 1/2 ATC, where ATE is the average treatment effect, ATT is the average treatment ...
0
votes
0answers
17 views

Multiple linear regression with dummy variables. Assumptions of t-test

I am running a regression model with multiple variables. One of the variables is a dummy and the rest are continuous. When i get the regression output (t value and P>t) i am wondering what the ...
2
votes
1answer
46 views

Multiple Linear Regressions with Identical Slopes

Is it possible to impose an identical slope during a multiple linear regression? See below I have 3 sets of data with a linear fit y=ax+b. I would like to simultaneously impose the same a (while ...
0
votes
0answers
26 views

How to interpret plot residuals vs fitted values?

I run a ols regression and want now check the linearity assumption. I found out that i have to plot the residuals vs the fitted values and if there is no non linear pattern the linearity assumption ...
2
votes
0answers
15 views

Assumption testing for a large amount of individual regression models and averaging R-squared?

I am running the following model for my thesis, a simple regression: \begin{equation} y_{i,t} = \alpha_t+\beta_tx_{p,t}+\varepsilon_{i,t} \end{equation} where Y is an observed variable (...
0
votes
0answers
27 views

I am trying to replicate a linear regression model in R that was run in SAS

when I run the following model lm(y~A*B, data=ex2) (where A and B are categorical variables) and compare it to the output from SAS (using a type III Anova and the same referent levels), I get the same ...
0
votes
0answers
24 views

Dealing with variable length time-series data for linear models

I am working with variable length time-series signals. I want to use a sliding window to extract features, things like mean, standard deviation, kurtosis, skewness. The length varies pretty ...
2
votes
1answer
47 views

REGRESSION :A log-linear interaction term

How do I interpret a log-linear interaction term, is it possible? My model: $Y= B_1 + B_2\log X_1 + B_3X_2 + B_4(\log X_1 X_2) + u $
2
votes
1answer
81 views

Time Series w/ Linear Regression

I have some time series data for prices that I'm trying to perform linear regression on. However, I feel that what I'm doing is incorrect and was hoping someone could point me in the right direction. ...
2
votes
3answers
42 views

Use increased R² between two linear regression models as prove for hypothesis

I have three variables A,B & C. My hypothesis states that both, A and B, have an influence on C. What is a good way to show this statistically? Is it safe to calculate two linear regressions in ...
0
votes
0answers
59 views

R: Difference between glm and gls

What are the differences between glm and gls in r? How do I choose which one to use for any set of data? I tried googling but nothing gives, are they the same thing in R? I know the other is general ...
2
votes
2answers
57 views

Does R Automatically Calculate Single Degrees of Freedom?

I would like to know whether R produces single degrees of freedom tests for a formula. Assume we have a model in R: ...
2
votes
1answer
24 views

Linear Regression in stats model OLS

After removing the insignificant variables(p-value >.05), I fitted the OLS model again. I found there are still many variables which had p-value < .05 earlier have p-value > .05 now. Do I need to ...
2
votes
1answer
44 views

trouble creating a negative log likelihood for a linear model in R [closed]

I am new to stats and R and I am having trouble figuring out how to calculate a function that gives me the NLL of a linear regression.
1
vote
0answers
29 views

How do I calculate the negative-log likelihood of a linear regression model in r? [closed]

I need to calculate the NLL of the regression and minimize it. How I can do this in R?
0
votes
1answer
18 views

proving linear relation with correlation

Given $\rho(x,y) =1$ where $\rho$ denotes pearson correlation coefficient. can you prove $y= mx+c$ where $m$ and $c$ are constants? I can go the other way around, but haven't yet proved this. I ...
0
votes
0answers
18 views

How do we predict the y2|y1 in mixed effect model?

The model I build is Tolerance ~ 1 + Exposure + Sex + Age + (Age | id) Suppose you are told that this individual has a tolerance of 2.5 at age 15, Exposure is 1.6. Predict what her tolerance was when ...
0
votes
0answers
21 views

How to test zero hypothesis with a linear model lm

I would like to test a zero hypothesis on a linear model in R ( H0: F = 0, H1: F/= 0). How do I do it? Is it adequate to just use a linear model and if its not significant, then H0 is true? My Code ...
2
votes
0answers
8 views

How to set up contrasts in a linear regression models that involve averaging over levels of another factor?

For simplicity, assume we have a linear model which looks like this: Outcome = beta0 + beta1*Treatment + beta2*Time + beta3*Treatment*Time + error where ...
1
vote
1answer
35 views

How to estimate the probability mass function of a discrete variable from moments

Consider a bounded, discrete random variable $X$ whose range is $(0,1,\ldots, M)$. We are given the first $k$ moments of this distribution, call them $m_1, \ldots, m_k$. We are interested in ...
1
vote
1answer
41 views

Residual Analysis assumptions for non-linear regression

I understand Regression analysis relies on the following assumptions about the residuals: Normally Distributed (normal plot of residuals) Be independent of each other (random and data must be time ...
0
votes
1answer
31 views

Using predicted probabilities from logistic regression as dependent variable in a linear regression

I'm trying to run a Response Surface Analysis in SAS, but this is only possible with a continuous outcome, whereas my outcome variable is binary. I got the advice to first run a logistic regression ...
1
vote
0answers
36 views

Examples of features construction for linear methods in Reinforcement Learning

I am referring to page 210 of of Sutton and Barto book on Reinforcement Learning available here: book Linear function approximation for state-value functions are of the form $$\hat{v}(s,\mathbf{w}) = ...
1
vote
1answer
44 views

How to Interpret p-value for categorical variable in multiple linear regresion? [duplicate]

I have a query on how to interpret the result for multiple regression with categorical variables. I have categorical variable called Stay_In_current_city_years which has 5 levels. After running the ...
5
votes
1answer
107 views

Need help understanding what a natural log transformation is actually doing and why specific transformations are required for linear regression [duplicate]

I’m taking an online “Intro to AI” course for which I’m doing some azure machine learning labs. This course is largely about how to apply azure ML solutions and, while there is an “essential math for ...
1
vote
1answer
74 views

Confidence Interval for non-smooth term in gam (mgcv)

I fitted a gam model in mgcv package and now want to get the confidence intervals for the non-smooth term. ...
1
vote
1answer
23 views

Random draw from a linear model

I'm building an individual-based model where one component includes increasing winter temperature over time (years). For each iteration of the model (say 1000 iterations that have 25 years each) I ...
0
votes
0answers
21 views

When to use variance stabilizing method?

Let's suppose we want to estimate $p$ from $m$ independant realisations of $X\sim Bin(n,p)$: $x_1,x_2,\dots,x_m$, with respective size $n_i$ $i$ in $\{1,\dots,m\}$. Let $p_i$ be $p_i:=x_i/n_i$. To ...
1
vote
1answer
39 views

How to deal with predictions if taking log of dependent variable

I have a very basic question about linear regression. I have a dataset where the response variable is largely skewed to the right -- if I take a log of it, the distribution becomes a lot closer to ...
1
vote
1answer
18 views

Dealing with negative values in a positive regression

What is the best way to deal with two sets of independent variables that have two different value ranges? I have one data set with values ranging from -1 to 1 and another data set ranging from 0 to 1....
4
votes
1answer
87 views

How to solve an adaptive lasso model?

Assuming we are working with a linear regression model, lasso penalization solves: \begin{equation} \min_{\beta}\left\{\left\lVert y-X\beta\right\rVert_2^2+\lambda\sum_{j=1}^p \left\vert \beta_j\...
1
vote
1answer
101 views

Meaning of residual maker matrix

Suppose that $M_1$ is the residual maker for a unity vector (i.e. a vector made of $n$ 1's). I am told that this matrix, when premultiplying a variable, transforms the variable "into deviations from ...
0
votes
1answer
35 views

Why do we use “Sum of Squared Errors” as loss function in linear regression? [duplicate]

What is a loss function? How can we relate the slope of Linear Regression with Sum of Squared Errors?