I have a df with individuals id in the 1st col, a response variable (grain yield) in the 2nd col and the following columns are markers data
id yield Snp1 Snp2 Snp3 Snp4 Snp5 Snp6
id1 4.5 2 2 0 2 0 2
id2 4.2 0 2 2 2 2 2
id3 4.1 0 2 2 2 2 0
id4 4.9 2 0 0 0 2 0
id5 5.4 0 0 2 2 0 2
id6 3.9 2 2 0 2 0 0
What I want to do is to fit a linear model in R with the effect of two groups of Snps, for example: the first group is Snp1 + Snp2 and the second group is Snp4 + Snp5 I don't know how to write the code, but my idea is the following:
model <- lm ( yield~ (group1) + (group2)
Thanks in advance.