Friday, 28 August 2015 14:12
To: r-help@r-project.org
Subject: [R] Piecewise regression using segmented package plotted in xyplot
Hi,
xyplot(threshold ~ age |frequency.a, data=rage,
groups=HL,
cex=0.5,
layout=c(7,4),
par.strip.tex=list(cex=0.8),
xlab="Age (years)",
ylab=&
I perhaps should have added a stronger warning here; note that the model
fitting in my previous post (below) uses explicit initial breakpoints for
segmented (specifically, c(30,60) at line 1 of the get.segments() ). if you
know where yours are, substitute them there. Otherwise, you'd need to us
There isn't an abline method for segmented, and even if there were you'd need
segments() for a segmented line plot. You're going to have to roll your own.
That will need a function to extract the break locations and predicted values
at those points
I don't have your data, so I can't do one spe
Hi,
xyplot(threshold ~ age |frequency.a, data=rage,
groups=HL,
cex=0.5,
layout=c(7,4),
par.strip.tex=list(cex=0.8),
xlab="Age (years)",
ylab="Threshold (dB SPL)",
na.rm="TRUE",
panel=function(x,y,groups,...) {
panel.superpose(x,y,groups=HL,...)
# panel.abline(segmented(lm(threshold~age
On 11/02/2015 4:30 PM, Goldschneider, Jill wrote:
> I was playing with some examples of piecewise regression using lm() and have
> come across a behavior I'm uncertain about.
> Below is simple 3-segment dataset. I compare predicted output of a model
> created by one call to lm() to that of 3 mod
I was playing with some examples of piecewise regression using lm() and have
come across a behavior I'm uncertain about.
Below is simple 3-segment dataset. I compare predicted output of a model
created by one call to lm() to that of 3 models created by 3 calls to lm().
In case A and B, the resul
On Sat, 15 Jan 2011, vito.muggeo wrote:
dear all,
The package segmented allows to estimate piecewise linear relationships
(*connected*
lines, i.e. a gradual change in the slope) with several breakpoints (known or
unknown)
within (generalized) linear models..
The package also includes some func
Thank u Doctor Muggeo,
I was just getting familiar with your package this morning..i find it
interesting 'cause so far is the only one that allows estimations for the
single slope parameters between brakepoints, by the slope() function.
Contrarily, supposing only one knot in a linear regression,I d
dear all,
The package segmented allows to estimate piecewise linear relationships
(*connected*
lines, i.e. a gradual change in the slope) with several breakpoints (known or
unknown)
within (generalized) linear models..
The package also includes some functions for plotting and testing..
Have a l
If you know the knot and want linear segments, lm (or any other "normal"
regression software) can perform the analysis. For example if you want to
regress y on x and have a knot a 20 the following code will work:
x <- runif(500,0,40)
plot(x)
for (i in 1:500) {
if (x[i] < 20) y[i] <- (-0.5*x[
You failed to specify 2 crucial issues: Are the join points known
(linear rgression, splines) or unknown (nonlinear regression)? And as
several have already indicated, what are the smoothness constraints?
-- Bert
On Fri, Jan 14, 2011 at 6:42 AM, Federico Bonofiglio
wrote:
> Hello everybody
>
oh yes, and the structchange package.
After a day of experimentation I couldn't figure out how to get the
structchange package to work for my problems. Although it is probably user
error on my part, the package seems to be specific to time series problems.
Also, I think it needed regularly spaced
I wish I had a better answer.
There are two things that I know of that use a direct approach:
The segmentation package seems to work well if you are doing a few fits, but
I had problems when I tried running it on loads of data. It's a bit tricky
to parametrize. When I tried investigating the in
Hello:
I just found 58 help pages in 32 contributed packages containing
the terms "piecewise" and "regression", as follows:
library(sos)
pr <- ???'piecewise regression' # for "piecewise" with "regression"
summary(pr) # 58 matches in 32 packages
pr # view the 58 links sorted by package
Searching the archives would surely be a better way to assemble a list
of candidate packages but the "segmented" package is surely in the list.
On Jan 14, 2011, at 9:42 AM, Federico Bonofiglio wrote:
Hello everybody
Quick question, if you'd like to throw a little tip:
does anyone knows a
Hello everybody
Quick question, if you'd like to throw a little tip:
does anyone knows a function that runs piecewise regression models with
coefficients estimation and inferences ?
Thank you
[[alternative HTML version deleted]]
__
R-help
Hi everyone,
I'm trying to fit a of piecewise regression model on a time series. The idea
is to divide the series into segments and then to apply linear regression
models on each segment but in a "global way" and considering
heteroskedasticity between the segments. For example, I build a time ser
Is a 95% CI on a breakpoint fixed effect legitimate when the nonlinear
equation is continuous but not differentiable at the breakpoint?
I used the nlme to generate a non-linear mixed-effects piecewise model
with initial slope zero prior to an unknown breakpoint. It did give a
95% CI for the bre
On Mon, Jan 4, 2010 at 6:24 AM, Walmes Zeviani
wrote:
> AD Hayward wrote:
>>
>> Dear all,
>>
>> I'm attempting to use a piecewise regression to model the trajectory
>> of reproductive traits with age in a longitudinal data set using a
>> mixed model framework. The aim is to find three slopes and
AD Hayward wrote:
>
> Dear all,
>
> I'm attempting to use a piecewise regression to model the trajectory
> of reproductive traits with age in a longitudinal data set using a
> mixed model framework. The aim is to find three slopes and two points-
> the slope from low performance in early
AD Hayward wrote:
>
> I'm attempting to use a piecewise regression to model the trajectory
> of reproductive traits with age in a longitudinal data set using a
> mixed model framework.
>
You might have a look a Alejandro Jara DPpackage which worked quite well for
me in a similar case.
Th
Dear all,
I'm attempting to use a piecewise regression to model the trajectory
of reproductive traits with age in a longitudinal data set using a
mixed model framework. The aim is to find three slopes and two points-
the slope from low performance in early age to a point of high
performan
22 matches
Mail list logo