Displaying 20 results from an estimated 1000 matches similar to: "Help with segmented package"
2012 Jan 10
1
Problem with segmented
Hi everyone.
I'm trying to use the segmented function with the following data:
For instance, I use segmented package as follow:
myreg2 = lm(xy$y ~ xy$x)
mysegmented = segmented(myreg2, seg.Z=~x, psi=c(245000), control =
seg.control(display=FALSE))
Which get me to the following error :
As a break point, a starting guess of 245000 seems fair.
Anyone has an idea why I'm getting such
2008 Oct 03
1
NA's in segmented
I am trying to fit a very simple broken stick model using the package
"segmented" but I have hit a roadblock.
> str(data)
'data.frame': 18 obs. of 2 variables:
$ Bin : num 0.25 0.75 1.25 1.75 2.25 2.75 3.25 3.75 4.25 4.75 ...
$ LnFREQ: num 5.06 4.23 3.50 3.47 2.83 ...
I fit the lm easily:
> fit.lm<-lm(LnFREQ~Bin, data=id07)
But I keep getting an error
2011 Nov 01
3
Greek letter
Hi everyone.
I'm trying to use small letter phi in a graph produced in R. However, the
small letter phi does not look as it should.
In fact, it looks like this:
http://r.789695.n4.nabble.com/file/n3963311/Untitled.png
instead of what is here http://en.wikipedia.org/wiki/Phi
Here's the code I use:
expression(phi [1])
Anyone has an idea?
With regards,
Phil
--
View this message
2012 Jul 03
2
Data manipulation with aggregate
Hi everyone.
I have these data :
myData = data.frame(Name = c('a', 'a', 'b', 'b'), length = c(1,2,3,4), type
= c('x','x','y','z'))
which gives me:
Name length type
1 a 1 x
2 a 2 x
3 b 3 y
4 b 4 z
I would group (mean) this DF using 'Name' as grouping factor. However, I
have a
2012 Nov 29
2
googleVis plot and knitr/sweave
Dear R users.
I'm currently making a report with knitr (RStudio) where I would like to
plot a googleVis map. However, the map generated is an HTML file which I
don't know how to integrate it in my report.
So my question is how to include a map generated with googleVis in a PDF
created with knitr/sweave.
Regards,
Phil
--
View this message in context:
2010 Oct 12
6
List or matrix of object
Hi everyone.
Is it possible in R to create a matrix or a list (vector) or R object. For
instance, I have
f1 <- function(x) sqrt(x%*%x);
f2 <- function(x) (2x+1);
I would like to do something like
L <- List();
L[1] = f1;
L[2] = f2;
So, is there a way to create matrix or vector that can contains R object.
With regards,
Phil
--
View this message in context:
2012 May 08
1
Error with psi value for 'segmented' package for R
Hi everyone,
while trying to use 'segmented' (R i386 2.15.0 for Windows 32bit OS) to determine the breakpoint I got stuck with an error message and I can't find solution. It is connected with psi value, and the error says:
Error in seg.glm.fit(y, XREG, Z, PSI, weights, offs, opz) :
(Some) estimated psi out of its range
This is the code I am using:
2009 Sep 04
1
predicting from segmented regression
Hello
I'm having trouble figuring out how to use the output of "segmented()"
with a new set of predictor values.
Using the example of the help file:
??set.seed(12)
xx<-1:100
zz<-runif(100)
yy<-2+1.5*pmax(xx-35,0)-1.5*pmax(xx-70,0)+15*pmax(zz-.5,0)+rnorm(100,0,2)
dati<-data.frame(x=xx,y=yy,z=zz)
out.lm<-lm(y~x,data=dati)
o<-## S3
2012 Apr 20
1
Quick question about princomp/biplot
Hi everyone.
I performing a simple PCA using the princomp function. Then, I use the
biplot function to show it. However, the function use line number to
represent samples. I would like to know if there's a way to use a dot
(point) instead of the line number when using the biplot function.
With regards,
Phil
--
View this message in context:
2011 Apr 18
2
Avoiding loop
Hi everyone.
I'm using matrix product such as :
#Generate some data
NCols = 5
NRows = 5
A = matrix(runif(NCols*NRows), ncol=NCols)
B = matrix(runif(NCols*NRows), ncol=NCols)
#First calculation
R = A%*%B
for(i in 1:100)
{
R = R%*%B
}
I would like to know if it was possible to avoid the loop by using something
like mapply or anything else.
Tx in advance,
Phil
--
View this message
2012 Apr 12
1
Help with vectorization
Hi every one. I have a exponential function (3 fitting parameters) that I
would like to use to produce data (6 series) without having to use a loop.
Here
wl = seq(300,500,1)
k1 = c(1.2e-6, 4.9e-6, 9.6e-6, 2.7e-10, 6.7e-8, 7.44e-6)
k2 = c(726, 352, 128, 5232, 1538, 128)
k3 = c(-176, -224, -257, 88.7, -111, -256)
stations = c('R5d', 'R5a', 'R9', '108',
2012 Oct 18
2
Re-projecting geotiff
Dear R users,
I'm currently trying to re-project a geotiff in another coordinate system.
For instance, I have a tif image in UTM 19 zone which I would like to
reproject into UTM 18. I was wondering if it was possible in R.
Furthermore, I looked into 'rgdal' package, but I can't really find out if
I'm doing the right thing. So far, here is what I'm doing:
library(rgdal)
2013 Dec 02
3
legend position
Hi all.
I'm ploting a raster and I can't find the proper way to move the legend. For example,
r = raster(system.file("external/test.grd", package="raster"))plot(r)
How can I put the legend at the desired position?
Thank in advance,Phil
[[alternative HTML version deleted]]
2012 Feb 06
1
Creating time series (ts) object
Hi everyone.
I have have a dataset with daily measurement from January 1st of 1966 up to
December 31th of 2011.
Here's the first part of the data:
Date SLEV
1/1/1966 1.086
1/2/1966 1.079
1/3/1966 1.133
1/4/1966 1.261
1/5/1966 1.391
1/6/1966 1.571
1/7/1966 1.728
1/8/1966 1.823
1/9/1966 1.97
1/10/1966 1.804
1/11/1966 2.02
1/12/1966 2.017
1/13/1966 1.86
1/14/1966 1.96
1/15/1966 1.813
1/16/1966
2005 Apr 17
1
nls segmented model with unknown joint points
Hello,
I am interested in fitting a segmented model with unknown joint points
in nls and perhaps eventually in nlme. I can fit this model in sas (see
below, joint points to be estimated are a41 and a41), but am unsure how
to specify this in the nlm function. I would really appreciate any
suggestions or example code. Thanks a lot. -andy
proc nlin data=Stems.Trees;
params b41=-3 b42=1.5
2010 Dec 01
3
Question regarding legend look
Hi everyone.
I have a quick question regarding the look of my legend in my plot. As you
can see in the next figure, I have 3 series.
http://r.789695.n4.nabble.com/file/n3067466/legend.png
However, I find rather difficult to differentiate the series 1 and 3
according to their line type (lty). I would like to know if it was possible
to make the line type in the legend to appear more clearly.
2007 Oct 30
1
R segmented package
Most of the data sets I'm dealing with exhibit a time trend.
We would like to get rid of the time trend.
The plot shows in some cases a monotonic increase of the dependent variable
with time. This is the easiest case.
In some other cases the plot shows a time trend where the dependent variable
changes slope 4-5 times along the observations measurement period.
I've attempted a segmented
2012 Aug 05
1
Problem with segmented function
Hi,
I appreciate your help with the segmented function. I am relatively new to
R. I followed the introduction of the 'segmented'-package by Vito Muggeo,
but still it does not work.
Here are the lines I wrote:
data_test<-data.frame(x=c(1:10),y=c(1,1,1,1,1,2,3,4,5,6))
lr_test<-lm(y~x,data_test)
seg_test<-segmented(lr_test,seg.Z~x,psi=1)
/error in segmented.lm(lr_test, seg.Z ~ x,
2007 Oct 30
2
Where can I find package "segmented" ?
I tried to install "segmented" from three different repositories but I keep
getting the following message on R window: ... Please, advice where to find
this package.
Thank you in advance.
Maura
> utils:::menuInstallPkgs()
--- Please select a CRAN mirror for use in this session ---
Warning: package 'segmented' is in use and will not be installed
> utils:::menuInstallPkgs()
2011 Aug 16
3
Text wrap
Hi everyone.
I have a long label that I would like to split. I found that I could use
"strwrap" for simple text. However, this is not working with this label:
str = expression(paste("< 20 ?m phytoplankton ","(cells ? ",mL^-1,")"))
plot(...., ylab = strwrap(str,20),...)
I suspect this is because I'm using "expression" for form my label.