Skip to main content
15 votes

Cubic splines in Cox model

The question is about varying knot locations if the number of knots is fixed. I go into this in https://hbiostat.org/rmsc/genreg . With a restricted cubic spline (natural spline) the smoothness ...
Frank Harrell's user avatar
13 votes

Cubic splines in Cox model

You have 3 helpful answers already. I'd just like to add a couple of cautions. First, when you say something like the cubic splines used in the Cox model to test the linearity for the continuous ...
EdM's user avatar
  • 93.6k
11 votes

Cubic splines in Cox model

So far, we have two answers, each from a very esteemed writer. Shawn says "of course it can" and demonstrates that. Frank says "it usually doesn't". Both are correct. But I think ...
Peter Flom's user avatar
  • 122k
11 votes

Cubic splines in Cox model

If I change the location of the knots, this can affect the results? Certainly, this is true of any spline fit. You are changing where the basis functions are being constructed, so naturally this will ...
Shawn Hemelstrand's user avatar
7 votes

Why GLM don't have an error term and why shouldn't residuals be i.i.d?

GLMs specify a conditional distribution at each combination of predictors. When that conditional distribution is normal with constant variance, then the errors about the mean will be i.i.d. normal and ...
Glen_b's user avatar
  • 284k
5 votes
Accepted

Omit continuous variable in categorical by continuous interaction

If you feed your model $(\text{woman}, 50000)$, $(\text{man}, 50000)$, $(\text{woman}, 150000)$, $(\text{man}, 150000)$, you will get three distinct net worth values, not four (assuming $\hat\beta_2\...
Dave's user avatar
  • 63.7k
5 votes

Why GLM don't have an error term and why shouldn't residuals be i.i.d?

GLMs are not supposed to generalize $y = X\beta + \varepsilon$. They generalize the equivalent$^{\dagger}$ notion of $\mathbb E\left[Y\vert X=x\right] = X\beta$. There is no error term in this about ...
Dave's user avatar
  • 63.7k
5 votes

Why GLM don't have an error term and why shouldn't residuals be i.i.d?

Arguably, regression concerns modeling the expected response. If we focus on this aspect of modeling, the "error" is less something intrinsic to a model than it is a way of calculating the ...
AdamO's user avatar
  • 63.1k
4 votes

Normality of residuals versus AIC and "best" fit

First, I will note that the strict adherence to the assumption of normality for the residuals in regression is at best contentious (see commentary on that here). I recently read a paper that showed ...
Shawn Hemelstrand's user avatar
4 votes

Cox model - unsure of time unit of analysis

Cox survival regressions don't directly model time at all. They just use the rank-ordering in time of event times, so you can use any time scale that makes sense. You can get predictions of survival ...
EdM's user avatar
  • 93.6k
3 votes

Cox model - unsure of time unit of analysis

I suppose that that tests are performed approximately every six months (rather than exactly every 180 days), so using months or even 6-month units as a measure of time would be appropriate. I don't ...
Roger V.'s user avatar
  • 4,296
3 votes

Gamma regression with XGBoost

The answers and comments at Loss function in for gamma objective function in regression in XGBoost? suggest that the scale parameter is just assumed to be 1. The model prediction is the mean of the ...
Ben Reiniger's user avatar
  • 4,663
3 votes

Identical SE values for different groups using emtrends

The standard errors for the indepvar1 time trends are the same because the design is balanced with respect to the indepvar1:time ...
dipetkov's user avatar
  • 10.2k
2 votes

Omit continuous variable in categorical by continuous interaction

I guess I am reiterating Dave's answer, but with a little more details for future readers. One way to look at a linear model with one categorical and one continuous variable, NW = b0 + b1xGender + ...
AAE's user avatar
  • 21
2 votes

Why GLM don't have an error term and why shouldn't residuals be i.i.d?

GLMs (generalized linear models) include a lot of different types of models. It's more of a family than a single model. Notably, the typical linear model is a special case of the GLM. A GLM ...
gung - Reinstate Monica's user avatar
1 vote

High dimensional regression with millions of covariates/features

Genome-wide association studies are one example. They are special because the models are quite sparse and because strong correlation between predictors is limited to genetic variants that are ...
Thomas Lumley's user avatar
1 vote

Mixed Effects with repeated measures design and covariate included

I think for your case, if we were using something like lme4 in R, your model would look something like this: ...
Shawn Hemelstrand's user avatar
1 vote

My model is giving inconsistent results

A negative-r-squared is possible, depending on the calculation, so that does not necessarily indicate a bug in your code. However, the statistical interpretation of $R^2<0$ is a poor model fit, as ...
Dave's user avatar
  • 63.7k
1 vote

How to measure the strength of relationship

It is not obvious what is meant by "approx normal time series" in your question. Judging from the rest of it, it seems you meant that both your time series $x_t$ and $y_t$ follow a white ...
Mr. Ivan's user avatar
1 vote

Omit continuous variable in categorical by continuous interaction

Technically, what Dave posted was right. I was confused about the notation OARC was using in Stata. Their notation in Stata (changed to this example) is ...
Atreya Dey's user avatar
1 vote

Bad regression predictions with probability values

Those probabilities are related to a binary variable, which I have to forecast exactly. I have heard of many situations where people want to predict a probability and have event probabilities as ...
Dave's user avatar
  • 63.7k

Only top scored, non community-wiki answers of a minimum length are eligible