Skip to main content
Retagged and slightly edited text.
Source Link
mkt
  • 20.4k
  • 11
  • 81
  • 187

I have a very simple basic question but I am unable to get my head wrap around.

I have a model Y = slope1variable1 + slope2variable2 + Intercept.

I used "lm"lm in R to get slope1, slope2 and Intercept.

In this case, variable1 is my main effect and I want to remove the effect of variable2. The goal is to see if there is any association between Y controlled for variable 2 (regressed Y) and variable 1.

In order to plot these :   

(1) Should I subtract observed_Y-slope2*variable2-Intercept-Residuals and whatever is remaining (I call this regressed Y) is actually the value that is due to variable 1 or   

(2) Can I use model_fitted_dot_values from R and plot that as a function of variable1 and claim that model_fitted_dot_values are the regressed values of my dependent variable?

Any help is greatly appreciated.

Thanks

Regards

I have a very simple basic question but I am unable to get my head wrap around.

I have a model Y = slope1variable1 + slope2variable2 + Intercept.

I used "lm" in R to get slope1, slope2 and Intercept.

In this case, variable1 is my main effect and I want to remove the effect of variable2. The goal is to see if there is any association between Y controlled for variable 2 (regressed Y) and variable 1.

In order to plot these :  (1) Should I subtract observed_Y-slope2*variable2-Intercept-Residuals and whatever is remaining (I call this regressed Y) is actually the value that is due to variable 1 or  (2) Can I use model_fitted_dot_values from R and plot that as a function of variable1 and claim that model_fitted_dot_values are the regressed values of my dependent variable?

Any help is greatly appreciated.

Thanks

Regards

I have a model Y = slope1variable1 + slope2variable2 + Intercept.

I used lm in R to get slope1, slope2 and Intercept.

In this case, variable1 is my main effect and I want to remove the effect of variable2. The goal is to see if there is any association between Y controlled for variable 2 (regressed Y) and variable 1.

In order to plot these : 

(1) Should I subtract observed_Y-slope2*variable2-Intercept-Residuals and whatever is remaining (I call this regressed Y) is actually the value that is due to variable 1 or 

(2) Can I use model_fitted_dot_values from R and plot that as a function of variable1 and claim that model_fitted_dot_values are the regressed values of my dependent variable?

Any help is greatly appreciated.

Tweeted twitter.com/StackStats/status/701751717218619393
Source Link

How to get the regressed output?

I have a very simple basic question but I am unable to get my head wrap around.

I have a model Y = slope1variable1 + slope2variable2 + Intercept.

I used "lm" in R to get slope1, slope2 and Intercept.

In this case, variable1 is my main effect and I want to remove the effect of variable2. The goal is to see if there is any association between Y controlled for variable 2 (regressed Y) and variable 1.

In order to plot these : (1) Should I subtract observed_Y-slope2*variable2-Intercept-Residuals and whatever is remaining (I call this regressed Y) is actually the value that is due to variable 1 or (2) Can I use model_fitted_dot_values from R and plot that as a function of variable1 and claim that model_fitted_dot_values are the regressed values of my dependent variable?

Any help is greatly appreciated.

Thanks

Regards