Reputation: 3
I am trying to run a glm model to check the variation in the mass of cricket which could be affected by age(numeric), altitude(High or low), temperature(two different temperatures) and the incubators(4 different incubators) they are kept it.
I have tried the glm model which seems to be fine theoretically. The data on excel is all checked as well. I am assuming I have to convert some of the data into binary or some sorts.
glm(crick$Mass ~ crick$Altitude*crick$Age + crick$Altitude*crick$suare(Altitude) + 1/crick$Nymph.ID + 1/crick$Population + crick$Temperature*crick$Altitude + 1/crick$Incubator)
This is the code I am trying to run.
Error in eval(predvars, data, env) : attempt to apply non-function this is the error message.
Upvotes: 0
Views: 59
Reputation: 70653
You need to properly specify the formula (e.g. see examples in ?glm
). Try
glm(Mass ~ Altitude*Age + 1/Nymph.ID + 1/Population + Temperature*Altitude + 1/Incubator, data = cricks)
Note that I excluded Altitude*suare(Altitude)
which is invalid R syntax for formulas. You'll have to explain more what you're trying to go with here.
Upvotes: 0