I have a reviewer that wants me to analyze my data along the lines:
Con_Ratio ~ Range * Latitude * Longitude + (1 | Genotype/Pair).
But I'm not sure if this can be done and how. My experimental design is where a caterpillar was given a choice of two genotypes of plant tissue- one from the native range and one from the invasive range. I have 38 genotypes divided between the two ranges. I calculated the Con_Ratio from the amount of that genotype consumed divided by the total amount of leaf consumed so I have a proportion. Each pair was replicated 5 times (except for one). The genotypes were not used an equal number of times and can appear in more than one pair. I want to answer if caterpillars prefer leaf tissue from one range over the other.
The reviewer was concerned that because some of my genotypes were close to each other this may have an effect and wanted the latitude and longitude included. They were also concerned because I use the Con_Ratio from both genotypes and want a Pair factor also. This means that I have 84 pairs.
I needed a starting point so this is what I ran but I'm concerned that I have proportion data and that there are so many factors for the Pair variable
PrefData <- read.csv("pref_data_18Jan2019.csv")
PrefData$Plate <- as.factor(PrefData$Plate)
PrefData$Pair <- as.factor(PrefData$Pair)
PrefDataCut <- subset(PrefData, Con_Ratio > 0)
PrefDataCut <- subset(PrefDataCut, Con_Ratio < 1) # This removes 28 points of user error
hist(PrefDataCut$Con_Ratio)
m1 <- lmer(Con_Ratio ~ Range * Latitude * Longitude + (1 + Range|Genotype/Pair), data = PrefDataCut)
plot(m1,type=c("p","smooth"))
plot(m1,sqrt(abs(resid(.)))~fitted(.), type=c("p","smooth"))
qqnorm(resid(m1))
qqline(resid(m1))
This gives a warning. Warning messages: 1: Some predictor variables are on very different scales: consider rescaling 2: Some predictor variables are on very different scales: consider rescaling
I read about using the logit function to transform the response variable so I tried that but the warning was the same and I also read it was better to use a glmer with the binomial and logit function. But I don't know how to do that because my data can't be transformed into 0 and 1. I also read about applying the weights option to include the number of counts but I was confused how to apply it based on my dataset.
Genotype/Pair
suggests)? $\endgroup$Con_Ratio
from the same genotype are correlated. Is this a reasonable assumption? $\endgroup$