+ Reply to Thread
Results 1 to 3 of 3

Thread: Link = log code won't work

  1. #1
    Points: 473, Level: 9
    Level completed: 46%, Points required for next Level: 27

    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Link = log code won't work




    Hi,

    doing a generalised linear model with poisson distribution, here is my model code...

    model<-glm(carnivore_abundance~altitude_1+dist_stream+canopy_openess+basal_area+dist_large_river,family=poisson,data=main_data)

    really frustratingly whenever I try to add link=log is doesn't work it comes up with several differnt errors depending on whether I add it in with brackets or quotations etc. The main error I get is: Error in glm.control(link = "log") : unused argument (link = "log")

    I am concerned this will impact the results I get back from the test as I assume adding this section is important. Does anyone know how to solve this? Any input would be greatly appreciated

  2. #2
    Devorador de queso
    Points: 90,003, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,835
    Thanks
    305
    Thanked 2,603 Times in 2,221 Posts

    Re: Link = log code won't work

    You should post the code that is actually giving you an error.

    But it sounds like you're just trying to add it as a parameter in the glm function. The link is specified inside of the family. So you want family=poisson(link = "log")

    But poisson defaults to log link so you don't really need to specify it in this case. You can view the defaults for each family by looking up the help page for family
    Code: 
    ?family
    I don't have emotions and sometimes that makes me very sad.

  3. #3
    Points: 473, Level: 9
    Level completed: 46%, Points required for next Level: 27

    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Link = log code won't work


    Thank you for your reply, it works now! So all that stressing over a little comma haha! Do you know if you need to put link=log for quasipoisson family?

    Thanks again

+ Reply to Thread

           




Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats