search for: curve2

Displaying 4 results from an estimated 4 matches for "curve2".

Did you mean: curve
2003 Aug 14
2
Using spline parameters to generate data
...t with cubic splines. # What I want to do is generate many thousands of similar samples using the parameters from the splines # For instance one data sample looks not unlike this: foo.curve <- 1 * exp(-0.01 * 1:500) + 0.5 ts.plot(foo.curve, lwd = 2) # Another sample looks not unlike this: foo.curve2 <- 0.9 * exp(-0.02 * 1:500) + 0.5 ts.plot(foo.curve2, lwd = 2) # They can be fit with splines easily like so: ts.plot(foo.curve, lwd = 2) spline.model <- smooth.spline(foo.curve) fits4foo <- predict(spline.model)$y spline4foo <- spline(1:500, fits4foo) lines(spline4foo$x, spline4f...
2007 Oct 19
1
unable to interactively label curves on a plot
...label curves on a single plot. The labcurve() function from Hmisc seems like the way to do this (?). I just can't seem to get it to work. Toy example: > x <- 1:10 > y1 <- x^2 > y2 <- 2*x > plot(x,y1) > lines(x,y2) > labcurve(labels=c("curve1", "curve2"), method="locator") From the help file, this is how I would understand it should be done, but have tried many other combinations, with no luck. Running up-to-date R, R packages and Fedora. Many thanks, Quin -- * * * * * * *Quin Wills* *DPhil candidate* * * *Department...
2006 Jul 17
1
use "factor" for categorical covariate in Cox PH model
...of the categorical covariate or not: if we don't add "factor", there is only one hazard ratio; if we add "factor", there are two hazard ratios. So does the "factor" actually create some dummy variables for the calculation? Here is the code example: curve2=survfit(Surv(CR, statcr) ~ factor(X1),data=dat1) where X1 have three categories. Thanks! [[alternative HTML version deleted]]
2008 Jul 07
4
Plot Mixtures of Synthetically Generated Gamma Distributions
Hi, I have the following vector which is created from 3 distinct distribution (three components) of gamma: x=c(rgamma(30,shape=.2,scale=14),rgamma(30,shape=12,scale=10),rgamma(30,shape=5,scale=6)) I want to plot the density curve of X, in a way that it shows a distinct 3 curves that represent each component. How can I do that? I tried this but doesn't work: lines(density(x)) Please