[R] Issue with 95% CI using MASS{confint}

Duncan Murdoch murdoch.duncan at gmail.com
Wed May 27 22:28:48 CEST 2015


On 27/05/2015 4:08 PM, Jennifer Sweatman wrote:
> I am trying to run a nonlinear model looking at seasonal abundance of
> plants with the following limitations:
> 
> 
> 
> fit.nls.s<-nls(S_a~beta+m*time+alpha*sin(w*time+phi),
> 
>              data= xy,
> 
>              start=list(beta=2.1, m=0, alpha=2, phi = 1, w = 1),
> 
>              upper=list(beta="inf", m="inf", alpha="inf", phi = 2*pi, w =
> "inf"),
> 
>              lower=list(beta="-inf", m="-inf", alpha=0, phi = 0, w =
> 0.0000001),
> 
>              algorithm="port")
> 
> 
> 
> I want to know the 95% confidence intervals for all of my model
> parameters.  I have been using confint from the MASS package but I’m
> getting some NA values.  See output below:
> 
> confint(fit.nls.s)
> 
>             2.5%     97.5%
> 
> beta  1.68170858 2.5635734
> 
> m     0.02810172 0.0710163
> 
> alpha         NA 0.6755750
> 
> phi           NA        NA
> 
> w             NA 1.0275199
> 
> The parameters I most need 95% CIs for are alpha and w (when alpha is
> significant), but I consistently get NA for the lower limit of both.  I
> have changed my Upper/Lower limits for alpha, phi, and w to +/- infinity,
> but my CIs still don’t include complete intervals. Any suggestions as to
> what is going on here?

Probably the profiling failed.  You could look at
plot(profile(fit.nls.s)) to see an indication of what's going on.  If
your tau values don't exceed 2 on one side of the estimate, you can't
get a confidence limit on that side.  Your data may not rule out any phi
values, or may not rule out a lower limit on alpha or w.

Duncan Murdoch



More information about the R-help mailing list