I have two datasets that I have done logistic regression for. When I plot them using predict()
the manip.model
is significantly lower than non.manip
model, however, they intersect at x=2.3. I would like to do a permutation test to see how often they intersect anywhere, or if this is just an artifact, but I can't figure it out. So far I have only performed very simple permutation tests and am having trouble with this more complicated one.
manip.model <- glm(catch~traplen, family=binomial, data=manip.data)
nonmanip.model <- glm(catch~traplen, family=binomial,
data=nonmanip.data)
predict(manip.model,data.frame(traplen=x),type="resp")
predict(nonmanip.model2,data.frame(preymass=x),type="resp")
Edit: This is what the data would look like where catch success is represented by 0 or 1, and treatment is represented by y or n. I am trying to determine the frequency that the predicted logistic regression line for treatment n would be lower than for treatment y over the range [1, 2.3] and greater for the range (2.3, 3].
df <- data.frame(traplen=sample(1.0:3.0, 10, replace=T),
manip=sample(c('y', 'n'), 10, replace=T), catch=sample(c('0','1'), 10,
replace=T))
df