Thanks for the nice explanation! At 8:15, I have a question concerning the use of nls in fitting the linear spline model. The nls function implements the Gauss-Newton algorithm, which essentially involves the Jacobian matrix of the regression function wrt the parameters. One underlying assumption is that the regression function is smooth (to be exact, having the first derivative) as a function of parameters. However, for the threshold c, the regression function is not smooth. This would cause a glitch in methodology, thought the R code might work out fine. Am I right?
It is a model parameter that is optimized with respect to least squares fit. This means that the computer iteratively tries different values for the knot(s) and regression parameters to find a set of values that make the sum of squared residuals as small as possible.
You can always (I assume) find the email of any channel on the channel about-page. th-cam.com/users/mronkkoabout But I prefer questions here over email and generally do not do online tutoring. That being said, if I get a specific question by email and I know the answer to that question so that it does not take long time to respond, I generally do that.
@@mronkko Kiitos! I have some questions. Please how can one do a restricted cubic spline using SPSS? Also, how can covariates be adjusted for in the cubic spline curves? Tv
@@NM-ng4dq Unfortunately I do not use SPSS myself so I cannot help you with that. But Googling restricted cubic spline using SPSS seems to give a few relevant resources. A spline regression is simply a regression model where you multiply some terms with binary variables that receive their value based on the estimated knots. Using covariates in these models works the same way that normal regression does. However, if you have a simple spline, it is possible that your statistical software does not implement covariates. But they can always be added by using general non-linear least squares estimation. I am not sure if SPSS supports that, though. But Stata and R do.
Great explanation. Thank you!
You are welcome!
Very nice explanation for a statistician working with R, very clear and understandable!
Glad it was helpful!
Thank you for this! "Excess slope" really made everything click:) good job!
You're welcome!
Thanks for the nice explanation! At 8:15, I have a question concerning the use of nls in fitting the linear spline model. The nls function implements the Gauss-Newton algorithm, which essentially involves the Jacobian matrix of the regression function wrt the parameters. One underlying assumption is that the regression function is smooth (to be exact, having the first derivative) as a function of parameters. However, for the threshold c, the regression function is not smooth. This would cause a glitch in methodology, thought the R code might work out fine. Am I right?
Hoy did you calculate knot in the example?
It is a model parameter that is optimized with respect to least squares fit. This means that the computer iteratively tries different values for the knot(s) and regression parameters to find a set of values that make the sum of squared residuals as small as possible.
Thank you for this. but i have a lot of question i don't know if i can have your email to discuss i will appreciate thank you.
You can always (I assume) find the email of any channel on the channel about-page. th-cam.com/users/mronkkoabout
But I prefer questions here over email and generally do not do online tutoring. That being said, if I get a specific question by email and I know the answer to that question so that it does not take long time to respond, I generally do that.
@@mronkko i want to do a restrictive cubic spline with weighed data (nhanes) in stata i really need help in that regard. i will appreciate
@@mronkko even in R i will appreciate. thank you
@@mronkko Kiitos!
I have some questions. Please how can one do a restricted cubic spline using SPSS?
Also, how can covariates be adjusted for in the cubic spline curves?
Tv
@@NM-ng4dq Unfortunately I do not use SPSS myself so I cannot help you with that. But Googling restricted cubic spline using SPSS seems to give a few relevant resources.
A spline regression is simply a regression model where you multiply some terms with binary variables that receive their value based on the estimated knots. Using covariates in these models works the same way that normal regression does. However, if you have a simple spline, it is possible that your statistical software does not implement covariates. But they can always be added by using general non-linear least squares estimation. I am not sure if SPSS supports that, though. But Stata and R do.