Description Usage Arguments Details Value Examples

View source: R/rms_SandwichAddon.R

As missing data is handled a little different for the ols
than for the lm we need to change the estfun to work with the `ols()`

1 2 | ```
## S3 method for class 'ols'
estfun(x, ...)
``` |

`x` |
A fitted ols model object. |

`...` |
arguments passed to methods. |

I have never worked with weights and this should probably be checked as this just uses the original estfun.lm as a template

matrix A matrix containing the empirical estimating functions.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ```
# Generate some data
n <- 500
x1 <- runif(n)*2
x2 <- runif(n)
y <- x1^3 + x2 + rnorm(n)
library(rms)
library(sandwich)
dd <- datadist(x1, x2, y)
org.op <- options(datadist = "dd")
# Main function
f <- ols(y ~ rcs(x1, 3) + x2)
# Check the bread
bread(f)
# Check the HC-matrix
vcovHC(f, type="HC4m")
# Adjust the model so that it uses the HC4m variance
f_rob <- robcov_alt(f, type="HC4m")
# Get the new HC4m-matrix
# - this function just returns the f_rob$var matrix
vcov(f_rob)
# Now check the confidence interval for the function
confint(f_rob)
options(org.op)
``` |

gforge/Greg documentation built on Sept. 23, 2019, 6:44 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.