Displaying 20 results from an estimated 3000 matches similar to: "How to plot confidence bands for nls"
2012 Jul 02
4
Removing rows if certain elements are found in character string
I would like to remove rows from the following data frame (df) if there are
only two specific elements found in the df$ch character string (I want to
remove rows with only "0" & "D" or "0" & "d"). Alternatively, I would like
to remove rows if the first non-zero element is "D" or "d".
2012 Jul 30
2
Alternating between "for loops"
Dear All,
I would like to apply two different "for loops" to each set of four columns
of a matrix (the loops here are simplifications of the actual loops I will
be running which involve multiple if/else statements).
I don't know how to "alternate" between the loops depending on which column
is "running through the loop" at the time.
## Set up matrix
J <- 10
N
2010 May 03
1
rpart, cross-validation errors question
I ran this code (several times) from the Quick-R web page (
http://www.statmethods.net/advstats/cart.html) but my cross-validation
errors increase instead of decrease (same thing happens with an unrelated
data set).
Why does this happen?
Am I doing something wrong?
# Classification Tree with rpart
library(rpart)
# grow tree
fit <- rpart(Kyphosis ~ Age + Number + Start,
2010 May 14
1
Cubic B-spline, how to numerically integrate?
(corrected version of previous posting)
I fit a GAM to turtle growth data following methods in Limpus & Chaloupka
1997 (http://www.int-res.com/articles/meps/149/m149p023.pdf).
I want to obtain figures similar to Fig 3 c & f in Limpus & Chaloupka
(1997), which according to the figure legend are "expected size-at-age
functions" obtained by numerically integrating
2010 May 13
1
GAM, GAMM and numerical integration, help please
I am trying to apply methods used by Chaloupka & Limpus (1997) (
http://www.int-res.com/articles/meps/146/m146p001.pdf) to my own turtle
growth data.
I am having trouble with two things...
1) After the GAM is fit, the residuals are skewed.
>m1 <- gam(growth~s(mean.size,
bs="cr")+s(year,bs="cr",k=7)+s(cohort,bs="cr")+s(age,bs="cr"),
data=grow,
2012 Dec 03
1
Confidence bands with function survplot
Dear all,
I am trying to plot KM curves with confidence bands with function survplot under package rms.
However, the following codes do not seem to work. The KM curves are produced, but the confidence bands are not there.
Any insights? Thanks in advance.
library(rms)
########data generation############
n <- 1000
set.seed(731)
age <- 50 + 12*rnorm(n)
label(age) <- "Age"
2005 Dec 29
1
use of predict() with confidence/prediction bands
To my understanding, a confidence interval typically covers a single
valued parameter. In contrast, a confidence band covers an entire line
with a band. In regression, it is quite common to construct confidence
and prediction bands. I have found that many people are connecting
individual confidence/prediction interval values produced with
predict(object,sd.fit=T,type="conf/pred") and
2005 Sep 28
1
confidence variability bands for kernel estimators
I'm using nonparametric regression (packeges ksmooth and ks). My question:
is there any way to compute confidence bands (or variability bands) with R.
Confidence bands for functions are intervals [CLO(x);CUP(x)] such that with
probability 1-alpha the true curve is covered by the band [CLO(x);CUP(x)].
Thanks very much for any help you can offer.
Michael G??lger
2006 Oct 20
2
plotting 95% confidence bands on a simple linear regression model from lm()
What's the best / simplest way to create 95% confidence bands for a
model created with lm() that can be plotted around teh regression
line? I've looked everywhere for this - I guess I must be missing
something.
- Jason
2012 May 03
1
overlapping confidence bands for predicted probabilities from a logistic model
Dear list,
I'm a bit perplexed why the 95% confidence bands for the predicted probabilities for units where x=0 and x=1 overlap in the following instance.
I've simulated binary data to which I've then fitted a simple logistic regression model, with one covariate, and the coefficient on x is statistically significant at the 0.05 level. I've then used two different methods to
2010 Aug 02
1
Confidence Bands in nonlinear regression using optim and maximum likelihood
Hello,
I am trying to plot confidence bands on the mean and prediction bands for the following
nonlinear regression, using maximum likelihood via optim. A toy example with data and
code of what I am trying to accomplish is:
VOL<-c(0.01591475, 1.19147935 ,6.34102460, 53.68809287, 91.90143074, 116.21397007,
146.41843056, 215.64535337, 256.53149673, 315.73609232)
Age <-c(1.622222, 2.833333
2008 Jun 17
1
Simultaneous Confidence/Prediction Bands
Is there a built-in function in R that will generate simultaneous confidence
and prediction bands for linear regression?
Tom
--
View this message in context: http://www.nabble.com/Simultaneous-Confidence-Prediction-Bands-tp17941537p17941537.html
Sent from the R help mailing list archive at Nabble.com.
2007 Jun 08
1
pointwise confidence bands or interval values for a non parametric sm.regression
Dear all,
Is there a way to plot / calculate pointwise confidence bands or
interval values for a non parametric regression like sm.regression?
Thank you in advance.
Regards,
Martin
2010 Nov 22
1
cpgram: access data, confidence bands
Dear R experts, beginners and everyone else,
I'm calculating "cumulative periodogram" using the command "cpgram"
[1] from the MASS library. Here is a short example with the "lh"
(hormone level) dataset:
library(MASS)
plot(lh,type="l",ylab="value",xlab="time", main="Hormone Levels (lh)")
spectrum(lh,
2005 Dec 20
2
need 95% confidence interval bands on cubic extrapolation
Dear R experts:
I need to get this plot, but also with 95% confidence interval bands:
hour <- c(1, 2, 3, 4, 5, 6)
millivolts <- c(3.5, 5, 7.5, 13, 40, 58)
plot(hour, millivolts, xlim=c(1,10), ylim=c(0,1000))
pm <- lm(millivolts ~ poly(hour, 3))
curve(predict(pm, data.frame(hour=x)), add=TRUE)
How can the 95% confidence interval band curves be plotted too?
Sincerely,
2011 Oct 17
1
Plotting GEE confidence bands using "predict"
Hello Fellow R
Users,I have
spent the last week trying to find a work around to this problem and I can't
seem to solve it. I simply want to plot my GEE model result with 95% confidence
bands.
I am using the geepack package to run a basic GEE model involving
nestling weights, to a Gaussian distribution, with "exchangeable" error
structure. I am examining how nestling weight varies
2009 Jun 16
1
Confidence Bands in Polynomial Regression
Hello R users,
Given a linear (in the parameters) regression model where one predictor x
interacts with time and time*time (ie, a quadratic effect of time t):
y = b0 + b1(x) + b2(t) + b3(t^2) + b4(x*t) + b5(x*t^2) + e,
I would like to construct 95% confidence bands (optimally, shaded) around
this function:
*dy* = b1 + b4(t) + b5(t^2)
*dx*
That is, the partial effect of x on y changing over
2010 Sep 11
3
confidence bands for a quasipoisson glm
Dear all,
I have a quasipoisson glm for which I need confidence bands in a graphic:
gm6 <- glm(num_leaves ~ b_dist_min_new, family = quasipoisson, data = beva)
summary(gm6)
library('VIM')
b_dist_min_new <- as.numeric(prepare(beva$dist_min, scaling="classical", transformation="logarithm")).
My first steps for the solution are following:
range(b_dist_min_new)
2012 Aug 08
1
Confidence bands around LOESS
Hi Folks,
I'm looking to do Confidence bands around LOESS smoothing curve.
If found the older post about using the Standard error to approximate it
https://stat.ethz.ch/pipermail/r-help/2008-August/170011.html
Also found this one
http://www.r-bloggers.com/sab-r-metrics-basics-of-loess-regression/
But they both seem to be approximations of confidence intervals and I was
wonder if there was
2010 Jul 02
1
xyplot: key inside the plot region / lme: confidence bands for predicted
I have two questions related to plotting predicted values for a linear
mixed model using xyplot:
1: With a groups= argument, I can't seem to get the key to appear
inside the xyplot. (I have the Lattice book,
but don't find an example that actually does this.)
2: With lme(), how can I generate confidence bands or prediction
intervals around the fitted values? Once
I get them, I'd