# Questions tagged [splines]

Splines are flexible functions, knit together from polynomial parts, used for approximation or smoothing. This tag is for any kind of spline (eg, B-splines, regression splines, thin-plate splines, etc).

370 questions
Filter by
Sorted by
Tagged with
17 views

### In R, how to estimate the spline curve by Least Square method? [closed]

n = 50 set.seed(100) x = matrix(runif(n, -2, 2), nrow=n) y = 2 + 0.75*sin(x) - 0.75*cos(x) + rnorm(n, 0, 0.2) In R, I want to estimate above spline function by ...
10 views

### p-value in restricted cubic splines regression

How to calculate the p for overall and p for nonlinearity for a RCS model in STATA? Like what they did in this picture.
34 views

### Replicating a Tweedie corrected experiment from Computer Age Statistical Inference

I have been attempting to replicate an experiment from Computer Age Statistical Inference by Bradley Efron and Trevor Hastie on page 411. In this experiment 100 datasets are populated normal random ...
21 views

### Representation of cubic-linear spline in mgcv::gam

I have a dataset of empirical hazard rates which I would like to model to produce a reasonable forecast of the survival rate. I'd like to use a cubic-linear spline to fit the logit-transformed hazards ...
41 views

### Trying to smooth small 'bumps' in graph data using spline interpolation for changepoint detection

I'm trying to detect changes in my data, I want to identify points that are like local minima and shoot upwards. I have used the changepoint package to do so, and upon running it and selecting my ...
10 views

38 views

### DOF of Natural Cubic Spline

I am curious as to what the answer to the below question is? The question specifies a modeler has a cubic spline with knots at {10, 20, 30, 50}. They realize their model is overfitting at the ends of ...
38 views

### Spline basis function notation to include constraint for continuity at the knots

I know splines use basis functions to approximate a function locally, so that the function in one region is approximated with a weighted sum of these basis functions. Suppose the input is one-...
12 views

### Can we get the specific formulation form of thin plate regression spline in GAM?

In mgcv package, the default smoother is thin plate regression spline. After building a GAM model, can we "write" the formula form of the thin plate regression ...
68 views

48 views

### When to choose regression splines over smoothing splines? [duplicate]

I am currently studying how to model covariates beyond linearity in order to use them with GAMs for regression / classification purposes. Talking about splines, two types were presented: regression ...
10 views

### Determine confidence in estimate from past estimates

I have a population on the order of 10,000 samples. These samples represent individual estimates of a variable, and for each estimate I also have the actual value of the variable. For each sample I ...
69 views

### contrast in plotHR for spline HR plot

I am using plotHR to plot spline with hazard ratio - I would like to set my reference point using 'cntrst'. In R: plotHR(mfit, term="td_macce30d_map", plot.bty="o", xlim=c(50, 110), xlab="MAP (mm Hg)...
433 views

### How different are restricted cubic splines and penalized splines?

I am reading a lot about using splines in various regression problems. Some books (e.g. Hodges Richly Parrameterized Linear Models) recommend penalized splines. Others (e.g. Harrell Regression ...
48 views

### How does one intuitively interpret significance of splines/GAM term?

Consider the data dput here. I can predict y from x using a cubic spline: ...
117 views

### splinefun build in function in R-programming

> t<-seq(0,1,len=5) > x<-matrix(c(1.3,2.3,21,2.4,3.8,9,4.5,11.3,4.2,7.8),2) > s1 <- splinefun(t, colMeans(x), method = "monoH.FC") > plot(s1) ...
40 views

### Censoring linearly splined predictor in regression

I'm developing a logistic regression where one of the independent variables has a non-linear relationship to the probability of the event occurring. I have created linear splines based on this ...
729 views

### Problems interpreting GAM output

I have been advised to run General Additive Models to be able to describe trends in my data, my data being animal harvest numbers by year. I have done so, but have a problem with interpreting the ...
291 views

### Thin Plate Regression Splines mgcv?

I am struggling on the understanding of thin plate regression splines. I already found a very helpful answer here in cross-validated: smoothing methods for gam in mgcv package but I still have some ...
35 views

### understanding derivatives of a regression spline

I am trying to understand why regression splines are continuous at their knots Suppose I am fitting a regression spline $$E[Y|X] = \alpha + \beta_1 x + \beta_2 (x - t)^+$$ where \$(x - t)^+ = \...
29 views

### How to measure the amount of confounding in tensor interaction in GAMs?

I am interested in fitting an additive model with tensor interaction terms. This construction is described in Wood (2006) and used in the mgcv ...
117 views

### Interpretation of cox.zph Output with Smoothing Splines in R

In Luke Keele's paper, "Covariate Functional Form in Cox Models", Dr. Keele carries out two Grambsch and Therneau non-proportionality tests, that is, one for a model without splines and one for a ...
23 views

### Knots in restricted cubic splines as free parameters or pre-assigned?

On p. 26 of Regression Modelling Strategies (2nd ed.) Frank Harrell argues against letting the knots in a RCS be free parameters and for setting them in advance, at various quintiles. He cites ...