# r program

1. ### Clinical Data Analysis in R for significant difference between 2 groups

Hi everyone. So I am doing a data analysis between variables of 2 groups to find a significant difference between them. I used the Games Howell test to find the difference as both groups have unequal data size. Now I would like to tabulate a table with all the results and values, but I am...
2. ### How to find the trend in binary time-series?

Hello everyone! I have an event that can happen with each of my patients (Y or N), collected over many years. Theses patients are independent of each other. I want to detect the trend taking into account the binary nature of my variable but also the number of cases per year. For example, I...
3. ### 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...
4. ### 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...
5. ### 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!
6. ### 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...
7. ### 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...
8. ### 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...