se_meanx: Asymptotic Standard Errors

View source: R/se_meanx.R

se_meanxR Documentation

Asymptotic Standard Errors

Description

These functions calculate the asymptotic standard errors of common statistical estimates. se_meanx calculates the standard error of the mean, se_sx calculates the standard error of the population standard deviation estimate, and se_rxy calculate the standard error of the correlation estimate between two vectors.

Usage

se_meanx(x, na.rm = FALSE)

se_rxy(x, y, na.rm = FALSE)

se_sx(x, na.rm = FALSE)

Arguments

x

A numeric vector, representing a sample from a population

na.rm

A boolean, whether or not to remove any NAs (default FALSE)

y

A numeric vector, representing a sample of a different variable

Value

A number representing the asymptotic standard error of the particular estimate

Examples

# calculate the mean and se of the mean of wage in the cps data
paste(
  "The average wage is",
  mean(cps$wagehr, na.rm = TRUE),
  "with a margin of error of",
  se_meanx(cps$wagehr, na.rm = TRUE)
)


probstats4econ documentation built on Sept. 11, 2024, 8:29 p.m.