-1
I don't know how to use sapply can anyone help me? I want to perform cubic spline regression use lm in R, with different degrees of freedom, for example, df=3,4,5,6,7,8. And then compute the RSS for each fitted model and stores the output in a variable rss.
rss_function<-function(df,data){
the.fit<