search for: pastbreakpoint

Displaying 1 result from an estimated 1 matches for "pastbreakpoint".

2012 May 23
0
gam (mgcv) vs. multiple regression breakpoint analysis: inconsistencies?
...tijn Wieling, University of Groningen ### breakpoint analysis using lm, both with and without covariate # note that AoEO indicates the AOA # LR denotes Length of Residence deviances1 = rep(Inf, 20) deviances2 = rep(Inf, 20) for (breakpoint in 6:20) { spk$ShiftedAoEO = spk$AoEO - breakpoint; spk$PastBreakPoint = as.factor(spk$ShiftedAoEO > 0); m1 = lm(LDlog ~ ShiftedAoEO:PastBreakPoint,data=spk) m2 = lm(LDlog ~ LR + ShiftedAoEO:PastBreakPoint,data=spk) deviances1[breakpoint] = deviance(m1) deviances2[breakpoint] = deviance(m2) } breakpoint = which(deviances1 == min(deviances1)) # 18 spk$ShiftedAo...