- CALCULATE SIMULTANEOUS 95% CONFIDENCE INTERVALS FOR THE ELEMENTS BY SPSS CODE INSTALL
- CALCULATE SIMULTANEOUS 95% CONFIDENCE INTERVALS FOR THE ELEMENTS BY SPSS CODE SERIES
So how bad are the intervals I created in the old post? They should as bad as the 95% point-wise interval, and they are oldCI <- apply ( fits, 1L, quantile, probs = c ( 0.025, 0.975 )) pred <- transform ( pred, lwrOld = oldCI, uprOld = oldCI ) fitsInOldCI <- apply ( fits, 2L, inCI, upr = pred $ uprOld, lwr = pred $ lwrOld ) sum ( fitsInOldCI ) / length ( fitsInOldCI ) 0.2655 (Intercept) 7.074e-01 2.435e-06 290527 = lwr & x <= upr ) } fitsInPCI <- apply ( fits, 2L, inCI, upr = pred $ uprP, lwr = pred $ lwrP ) fitsInSCI <- apply ( fits, 2L, inCI, upr = pred $ uprS, lwr = pred $ lwrS ) sum ( fitsInPCI ) / length ( fitsInPCI ) # Point-wise sum ( fitsInSCI ) / length ( fitsInSCI ) # Simultaneous 0.3028Īs you can see, the point-wise confidence interval includes just a small proportion of the posterior simulations, but the simultaneous interval contains approximately the right number of simulations for a 95% interval. I won’t cover how the GAM is fitted and what all the options are here, but a reasonable GAM for these data is fitted using mgcv and gam() m |t|) The aim of the analysis of these data is to model how the measured strontium isotope ratio changed through time, using a GAM to estimate the clearly non-linear change in the response. The data are shown below using ggplot() ggplot ( fossil, aes ( x = age, y = strontium.ratio )) + geom_point () The strontium isotope example data used in the post
CALCULATE SIMULTANEOUS 95% CONFIDENCE INTERVALS FOR THE ELEMENTS BY SPSS CODE SERIES
The fossil data set includes two variables and is a time series of strontium isotope measurements on samples from a sediment core.
CALCULATE SIMULTANEOUS 95% CONFIDENCE INTERVALS FOR THE ELEMENTS BY SPSS CODE INSTALL
If you don’t have SemiPar installed, install it using install.packages("SemiPar") before proceeding library ( "mgcv" ) library ( "ggplot2" ) theme_set ( theme_bw ()) data ( fossil, package = "SemiPar" ) First, load the packages we’ll need as well as the data, which is data set fossil. Confidence Interval for the Mean 95, and. As example data, I’ll use the strontium isotope data set included in the SemiPar package, and which is extensively analyzed in the monograph Semiparametric Regression (Ruppert et al., 2003). purchase SPSS or find a computer laboratory in which SPSS has been. Here, I demonstrate one way to compute a simultaneous interval for a penalised spline in a fitted GAM. I’ll tackle the issue of simultaneous intervals for the derivatives of penalised spline in a follow-up post.
Here I hope to rectify that past mistake. I have no idea what I was thinking when I thought the intervals described in that post were simultaneous.
It was a nice post that attracted some interest. Eighteen months ago I wrote a post in which I described the use of simulation from the posterior distribution of a fitted GAM to derive simultaneous confidence intervals for the derivatives of a penalised spline.