0

I am trying to run this code but I have an error could you help

Ag<-read.table("/Users/Desktop//AGE.csv", header=T)
PoGLM<-glm(tdt$NC.x~AGEF, family=poisson(link="log"))
prf<-predict(PoGLM,newdata=Ag, type="response")
Warning message:
'newdata' had 73 rows but variables found have 371380 rows 
r2evans
  • 141,215
  • 6
  • 77
  • 149
Ebtihaj
  • 19
  • 1
  • 1
    Please read about [minimal, complete, verifiable examples](https://stackoverflow.com/help/mcve). It is difficult to do much without seeing something reproducible. – r2evans Mar 28 '18 at 01:09
  • This is occurring because the regression formula restates the data frame name (`tdt$NC.x~AGEF` rather than `NC.x~AGEF`). Code should be `glm(NC.x ~ AGEF, family=poisson(link="log"), data=tdt)`. See [**here**](https://stackoverflow.com/a/27465510/496488) for an explanation. – eipi10 Mar 28 '18 at 01:23

0 Answers0