Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5928171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:15:42+00:00 2026-05-22T14:15:42+00:00

i’m trying to fit a negbin model with sqrt link. Unfortunately it seems to

  • 0

i’m trying to fit a negbin model with sqrt link. Unfortunately it seems to be that I have to specify starting values. Is anybody familiar with setting starting values when running the glm.nb command (package MASS)?

When I don’t use starting values, I get an error message:

no valid set of coefficients has been found: please supply starting values

Looking at ?glm.nb it seems to be possible to set starting values, unfortunately I absolutely don’t know how to do this. Some further information: 1.When computing the regression with the standard log link, the regression can be estimated. 2. It is not possible to set the start value for the algorithm to an arbitrary value, so for example

glm.nb(<model>,link=sqrt, start=1)

does not work!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:15:43+00:00Added an answer on May 22, 2026 at 2:15 pm

    Finding suitable starting values can be difficult for sufficiently complex problems. However for setting the starting values (the documentation of which is not great, but exists) you should learn to read the error messages. Here is a replicate of your unsuccessful attempt using start=1 with a built-in data set:

    >quine.nb1 <- glm.nb(Days ~ Sex + Age + Eth + Lrn, data = quine, 
                        link=sqrt, start=1)
    Error in glm.fitter(x = X, y = Y, w = w, start = start, etastart = etastart,  : 
      length of 'start' should equal 7 and correspond to initial coefs for 
      c("(Intercept)", "SexM", "AgeF1", "AgeF2", "AgeF3", "EthN", "LrnSL", )
    

    It tells you exactly what it is expecting: a vector of values for each coefficient to be estimated.

    quine.nb1 <- glm.nb(Days ~ Sex + Age + Eth + Lrn, data = quine, 
                        link=sqrt, start=rep(1,7))
    

    works, because I gave a vector of length 7. You might have to play around with the actual values in it to get a model that always predicts positive values. It is likely that the default algorithm of generating starting values in glm.nb gives negative prediction somewhere, and the sqrt link cannot tolerate that (unlike the log). If you are having trouble finding valid starting values by hand, you can try running a simpler model, and expand estimates from it by 0’s for the other parameters to get a good starting location.

    EDIT: building up a model

    Suppose you can’t find valid starting values for your complicated model. Then start with a simple one, for example

    > nb0 <- glm.nb(Days ~ Sex, data=quine, link=sqrt)
    > coef(nb0)
    (Intercept)        SexM 
      3.9019226   0.3353578 
    

    Now let’s add the next variable using the previous starting values by adding 0 estimates for the effect of the new variable (in this case Age has four levels, so needs 3 coefficients):

    > nb1 <- glm.nb(Days ~ Sex+Age, data=quine, link=sqrt, start=c(coef(nb0), 0,0,0))
    > coef(nb1)
    (Intercept)        SexM       AgeF1       AgeF2       AgeF3 
      3.9127405  -0.1155013  -0.5551010   0.7475166   0.5933048 
    

    You usually want to keep adding 0’s and not, say, 100’s, because a coefficient of 0 means that the new variable has no effect – which is exactly what the simpler model that you just fitted assumes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.