se_boot: Estimates bootstrapped standard errors for regression models

se_bootR Documentation

Estimates bootstrapped standard errors for regression models

Description

Takes in a data frame, regression formula, and bootstrapping parameters and estimates bootstrapped standard errors for models with and without fixed effects.

Usage

se_boot(data, formula, n_x, n_samples, sample_size, weights = NULL)

Arguments

data

A data frame containing the variables provided in 'formula'.

formula

A string containing a regression formula, with or without fixed effects.

n_x

An integer representing the number of independent variables in the regression.

n_samples

An integer indicating how many times the model should be estimated with a random subset of the data.

sample_size

An integer indicating how many observations are in each random subset of the data.

weights

Optional string with the column name in 'data' that contains weights.

Value

A named list containing bootstrapped standard errors for each coefficient.

Examples


se_boot(data = bottles, formula = "Salnty ~ T_degC + ChlorA + O2Sat",
        n_x = 3, n_samples = 4, sample_size = 300)

se_boot(data = data.frame(x1 = rnorm(50000, mean=4, sd=10),
                          x2 = rnorm(50000, sd=50),
                          ID = rep(1:100, 500),
                          area = rep(1:50, 1000),
                          y = rnorm(50000)),
        formula = "y ~ x1 + x2 | ID",
        n_x = 2, n_samples = 10, sample_size = 1000)


speccurvieR documentation built on Oct. 10, 2024, 1:08 a.m.