Search results

  1. S

    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|)...
  2. S

    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 +...
  3. S

    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!
  4. S

    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...
  5. S

    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!
  6. S

    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)...