On 2/19/2008 2:22 PM, Benjamin Zuckerberg wrote:
>
> I am encountering an error when I attempt to reference a glm model
> within a function. The function uses the segmented.glm command
> (package = segmented). Within the segmented.glm command one specifies
> an object, in this case a logistic regression model, and specifies a
> starting threshold term (psi). I believe this is an environment
> problem, but I do not have a solution. Any assistance would be
> greatly appreciated. The function is as follows:
>
>> colonization <- function(x,y){> }
> library(segmented)
> col <- subset(final,final[,x] == 2 | final[,x] == 4)
> col[,x] <- ifelse(col[,x] == 2,1,0)
> glm1 <- glm(col[,x]~col[,"PLAND"],family=binomial)
> glm2 <- segmented.glm(obj = glm1, seg.Z = ~PLAND, psi=y, it.max = 100)
>> colonization("PIWO",48)
You could use traceback() to find the location of the error, but I would suspect it's a bug in segmented.glm. You should contact the maintainer of that package (Vito Muggeo) to work it out. (I've cc'd him.)
Duncan Murdoch
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.
Archive generated by hypermail 2.2.0, at Tue 19 Feb 2008 - 20:30:15 GMT.
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.