Hot answers tagged

7 votes

Understanding spline transformation and regression coefficients

Conceptual Discussion Roland seems to present an answer for how one can derive the function based off the programming. I think your core question however remains unanswered...what do the coefficients ...
Shawn Hemelstrand's user avatar
6 votes

Understanding spline transformation and regression coefficients

Shawn’s answers are excellent. To add a few other considerations: Linear splines are very easy to interpret because parameters represent an initial slope and increments in the slope as you cross ...
Frank Harrell's user avatar
3 votes

When analysing time series data with lme4, how do you include both a step-change and a slope-change?

Your model currently has a single fixed time parameter, which is the same for all observations. The estimate is very slightly negative, so all your predictions ...
PBulls's user avatar
  • 3,658
3 votes

Why does centering predictors resolve non-convergence in lme4?

I doubt that centering your predictors will have much of an effect on convergence in itself. What may help in some cases is rescaling. The combination of the two operations is usually called '...
PBulls's user avatar
  • 3,658
2 votes
Accepted

How to constrain a GAM to non-negative values

For a concentration, the data will be either strictly positive or they will be left censored. A 0 observation is not technically possible in most situations as in general we are measuring using ...
Gavin Simpson's user avatar
2 votes
Accepted

Clogit and no variation in strata

If you mean the clogit function in the survival package, strata with no variation in the predictor are not dropped; they just ...
Thomas Lumley's user avatar
1 vote

Optimizing relative errors with GAMs

This is very easy to do in mgcv by specifying weights for the observations. This is the weights argument in the ...
Doctor Milt's user avatar
  • 2,672
1 vote

How to show in R, using a simulation, that when sampling from a normal distribution, the sample mean and sample variance are independent

But i know this is not enough to prove independence. To prove independence, you need a mathematical result. Simulation is an empirical tool, and you will not be able to prove the result with any ...
Demetri Pananos's user avatar
1 vote

Link function for exponential regression

Your two approaches are similar, but different. On the one hand, the identity link models $$ E[\log(y) \mid X=x] = x^T \beta $$ where as the log link models $$ \log(E[\log(y) \mid X=x]) = x^T \beta $$ ...
Demetri Pananos's user avatar
1 vote
Accepted

determining time points for 75% survival or 25% survival from Kaplan-Meier curve using R

You could obtain the quantiles of the survival curve by specifying them manually. In the above example, the quantiles for the answer survival curve can be generated ...
Michael Grogan's user avatar
1 vote

Can tbats forecast partial years

TBATS models seasonality in the data with periods equal to the seasonal periods specified. If your data is not periodic, then it's not going to find the seasonal patterns, and may just settle for a ...
Rob Hyndman's user avatar
  • 56.4k
1 vote

R: Computing relative weights for linear mixed model importance?

The dominanceanalysis::dominanceAnalysis function is what you need. Please see this: https://github.com/clbustos/dominanceAnalysis/
Le Quang Nam's user avatar
1 vote

How to constrain a GAM to non-negative values

One common way would be to specify a link function with non-negative domain for a response distribution with non-negative support via the family argument.
statmerkur's user avatar
  • 5,830

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