r program

  1. S

    Basic doubt - dummy code vs. hierarchical model

    I have a basic doubt on when to use country code as dummy coded control variables in regression and when to model it as a higher level variable within which other independent variables are nested. In my specific study, I have borrowers from several countries using an online P2P portal for...
  2. S

    Generating data from exponential distribution in r.

    Suppose X~exp(.67), Y~exp(.8), Z~exp(.43). X and Y are correlated with a correlation coefficient of -0.6. Again X and Z are correlated with a correlation coefficient of -0.6. How can I generate data from X, Y and Z by incorporating this correlation. I know if they were uncorrelated, I could...
  3. L

    Subset based on missing in differnet variables

    Suppose I have credit ratings for 5 years (credit1, credit2, credit3, credit4, credit5). I only want to keep observations which have at least three non-missing credit scores of any combination. Is there a more efficient way to do this than using rbind? Thank you!
  4. A

    Permanova using adonis, comparing a focus group with the rest (all other groups)

    Dear all I would like to compare the community composition of a certain region, against the composition of the neighbouring regions. This is an attempt to validate the ecoregion itself (its species composition is significantly different from that of its neighbours, or needs to be reassessed...
  5. B

    Scaling variables in regression

    If you need to scale variables in order to get the correct effect size and beta weight for each variable, does this mean you also scale for both categorical and continuous variables? For example: Model1=lm(DV ~ X + Y + Z) In the above equation, is it correct to scale for x/y/z or would...
  6. B

    Calculating effect size with interaction term

    If I am running multiple regression in r, what is the next step in order to get the effect size for all variables when there's also an interaction term in the equation. For example: model=lm(DV ~ Var1 + Var2 + Var2:Var3) Also, what's the best way to determine whether or not to do an...