Displaying 1 result from an estimated 1 matches for "bmij".
Did you mean:
mij
2013 Jan 10
2
piece-wise linear regression nls function
...ight lines where the two lines intersect at an x value given by the variable knot. I wish to estimate the slope of both lines, the value of knot, the x value where the two lines intersect, and an intercept. I am using the nls code below, and get the following error message:
Error in nls(FM ~ blow * BMIJS + bhi * sapply(BMIJS - knot, max, 0), start = list(knot = 25, :
singular gradient
nls code:
test <- nls(FM~blow*BMIJS+bhi*sapply(BMIJS-knot,max,0),start=list(knot=25,blow=1,bhi=1),data=FeMaleData)
summary(test)
greatly shortened version of my data (the full data set has 450 records)...