Message-ID: <VI1PR06MB5069823FEB2F232B5EF356569F099@VI1PR06MB5069.eurprd06.prod.outlook.com>
Date: 2022-03-08T20:44:35Z
From: Mélina Cointe
Subject: NA's in segmented
Hi,
I?m contacting you because I have some trouble with the slope() function of segmented. When I plot the predicted value everything seems to have worked well. But when I use slope(), the slope for the first segment is a line with 0 and Nas? Also I can get a negative slope whereas on the graph it?s clearly a positive slope?
Here are the lines I?m using :
Mod = lm(as.numeric(data[,"meanMSD25"])~(as.numeric(data[,"Slice"])), weights=1*sqrt(as.numeric(data[,"Detec"])))
x = (as.numeric(data[,"Slice"]))
o <- segmented(Mod, seg.Z=~x, psi=NA, control=seg.control(display=FALSE, K=2))
Thanks in advance for your help,
Best regards,
M?lina COINTE
[[alternative HTML version deleted]]