# Search results

1. ### should my model include separate predictors?

Let's say I measured blood pressure on day1 and day2 three times a day (morning, afternoon and evening). dat <- data.frame(ind=c(1,1,1,2,2,2,3,3,3,4,4,4), day1=c(90,113,122,86,84,95,114,126,123,115,92,103), day2=c(141,123,134,112,112,115,92,100,121,133,124,89)...
2. ### regression coefficient as average effect

In OLS, given the regression equation y = B0 + B1X, why do I often read that B1 represents the average effect of a predictor? I don't get that. For example, data <- data.frame(sex=c("male","female","male","female","male","female","male","female"), DV=c(22,32,34,16,66,34,77,23)) The average...
3. ### error term in linear regression

Let's say I have a simple model like this: yi ~ beta1*xi + errori > dat <- data.frame(y=c(10,20,30,40),x=c(1,2,5,8)) > m <- lm(y~x,data=dat) summary(m) gives me this information Residuals: 1 2 3 4 -3 3 1 -1 Coefficients: Estimate Std. Error t value Pr(>|t|)...
4. ### help in setting up model with confounding variables

Hi! if I have a multiple regression model with two IVs such as DV ~ IV1 + IV2 + IV1:IV2, what is the appropriate way to include a confounding variables (COV) in the model? DV ~ IV1 + IV2 + IV1:IV2 + COV or do I need to specify all interactions with the COV as well? DV ~ IV1 + IV2 + COV +...
5. ### orthogonalization question

Hi, is it a good idea to orthogonalize regressors in a regression model if they happen to be correlated? What are the cons and pros of orthogonalization? Thanks!
6. ### best fitting lines in PCA

Hi, I'm learning about PCA and I don't get the point that PC2 is the next best fitting line after PC1. Wouldn't the second best fitting line be a line which is close to PC1? This second line will not be orthogonal to PC1 (which I'm aware is required) but it's likely to have a sum of squares of...
7. ### orthogonal lines

Hi! I'm trying to learn PCA and am struggling with the concept of orthogonal lines, and why they need to be orthogonal. Is it correct to say that if two lines are orthogonal to each other then they are uncorrelated, independent or both? Thanks!
8. ### question regarding grouping several variables

Hello! In the context of regression, in what situations am I allowed to group separate variables into a single categorical predictor? I'll use R code as an example since it's what I'm most familiar with. For example I could run a model like this: dat <- data.frame(ind=c(1,2,3,4,5,6)...