Skip to main content
14 events
when toggle format what by license comment
Mar 30, 2022 at 13:06 comment added Eco007 yes I decided to print the model with a natural spline within an effect plot! Because the relationship prints as an inverted U-shape I then picked the peaks and did two regressions. I think this is also a point seeing that a relationship (fractionalization index - tax morale) turns negative after some point :-) I also don't think that interactions with polynomial terms are more easy to interpret than spline functions :-D
Mar 28, 2022 at 13:24 comment added EdM @Eco007 a fit with a poly() predictor term too often behaves poorly. Dichotomization is not a good choice. Stick with splines. Plots (with confidence limits) of log-odds versus predictor (as I show in the answer) or of probability versus predictor, or examples of particular predictor-variable combinations of interest, are ways to present your results.
Mar 28, 2022 at 12:52 comment added Eco007 Doh, ok... why can't relationships pretend to be linear??? :-( I also plotted the predicted probabilties from an rsc(x,3) and a poly(x,2) which seemed relatively equal but I am still not sure how to present the thing.... What would you recommend? It is an index of fractionalization ranging from 0.028 to 0.428. I thought of just using a log/ dichotomizing or using a polynomial. But I also don't get the function behind the command poly(x,2). It is not $ X \beta = X + X^2 $ right? If I simply use y ~ x + I(x^2) it also throws an error that my model has too large eigenvalues.
Mar 27, 2022 at 21:45 comment added EdM @Eco007 although you could in principle try to use rcs() in the clm() function, as it just defines a different model matrix to describe the spline, I can see how that different parameterization versus ns() might lead to numeric problems as clm() wasn't designed to handle rcs() terms. Note the numerical scale differences in the plots of spline components versus predictor values. If you want to get a formal equation, stick with the rms tools and use lrm(), with weights as appropriate.
Mar 27, 2022 at 21:37 comment added EdM @Eco007 that $(x)_+$ form (or pmax(x,0) in the lrmFunction) represents a step change in the equation when the argument $x$ exceeds 0. In the full equation there are several such arguments (like in $(\text{Freq}-6)_+$, where $x=\text{Freq}-6$) representing whether the predictor value has exceeded one or more of the knots. All those terms here, however, are cubic terms. The rcs(x,3) coefficient is for the linear component of the spline fit, but the '/'' indicators from rcs() don't represent derivatives, just higher-level non-linear terms. Don't try to interpret them individually.
Mar 27, 2022 at 21:17 comment added Eco007 :-) Thanks a lot!! So only few questions: the $(x)_+ = x \ \text{for}\ x>0$ stands for the linearity in $x$? here I get two coefficients rcs(x, 3) and rcs(x,3)'. The latter is the first derivative of the spline function? And would you advise to use the rcs function within a clm model? When I use interactions terms together with the spline it tells me anyway that the model is unidentifiable because of too large eigenvalues...
Mar 27, 2022 at 15:22 comment added EdM @Eco007 I added examples for Predict() and Function() with the lrm() function, which allows for case weights and ordinal regression. The orm() function is designed more for modeling continuous outcomes via proportional odds. Both ns() and rcs() use restricted cubic splines, which are "restricted" in that the functions are linear beyond the outer knots. That's hard to tell with ns() as its default outermost knots are at the limits of the values. Those two functions use different spline bases and default knot locations.
Mar 27, 2022 at 15:09 history edited EdM CC BY-SA 4.0
deleted 5 characters in body
Mar 27, 2022 at 15:00 history edited EdM CC BY-SA 4.0
illustrated Predict and Function
Mar 27, 2022 at 7:54 comment added Eco007 I went through the book but I still don't get the "Formula" of my model. What would be the interpretation of the restricted cubic splines?
Mar 27, 2022 at 6:56 comment added Eco007 FOA thank you. I thought something like this... I also went through the course notes and his boot (...not in detail for time reasons...). BTW the book link.springer.com/book/10.1007/978-3-319-19425-7 is really great! I tried the orm function but could not enter weights (I have survey data with weights). Do you know about an option for that? And also I couldn't find this Function() function...
Mar 26, 2022 at 15:41 history edited EdM CC BY-SA 4.0
corrected specification of knot location in rcs()
Mar 26, 2022 at 14:46 history edited EdM CC BY-SA 4.0
deleted 11 characters in body
Mar 26, 2022 at 14:41 history answered EdM CC BY-SA 4.0