I have a data frame that looks like this:
ID SEX PHENO HLA1 HLA2 HLA3 KIR1 KIR2 Output PC1 A1 1 1 2 1 1 1 1 4.643453 -0.0062 A2 2 1 1 1 1 1 NA 4.954243 -0.0207
I am interested in analysing the effect of the interaction between the HLAs and the KIRs, depending on several covariates, using R.
In the data set, I have the following variables:
- ID: individual IDs
- SEX: categorical variable having two categories (male and female) = covariate
- HLA (1 to 3): observed HLA phenotype = categorical variable (NA: missing; 1: absent; 2: present) =
- KIR (1 to 2): observed KIR phenotype = categorical variable (NA: missing; 1: absent; 2: present)
- Output: continous quantitative variable
- PC1: continous quantitative variable = covariate
Per KIR/HLA interaction, I was thinking in creating the interaction model using a linear regression model with interaction as follows:
lm(Output ~ HLA + KIR + HLA*KIR + PC1 + SEX)
...where PC1 and SEX are the covariates.
Does someone know if this is a good model since I have both categorical and quantitative variables in my dataset? Should I use another model?
Thank you for your help.