sampdistC {RCPA3}R Documentation

Plots probability and cumulative density functions (PDFs and CDFs) of sample statistics

Description

Visualize expected sampling distributions for sample statistics. You can plot the probability and cumulative density functions for statistics based on either the normal distribution or a t-distribution. The sampdistC function also generates the confidence interval (default 95%) for a sample statistic which is useful for obtaining the CI of a summary statistic (when you're not estimating it from the dataset yourself).

Usage

sampdistC(stat, se, t.df, plot.cdf = FALSE, ci = 95, digits = 3,
  printC = FALSE)

Arguments

stat

A numeric statistic, the point estimate of a parameter based on a sample of observations, like a sample mean or a sample proportion.

se

The standard error of the statistic, must be a positive number.

t.df

(Optional) If critical values for sampling distribution should be based on t-distribution (generally true when statistic is a mean), set t.df to the number of degrees of freedom (typically n-1).

plot.cdf

(Optional) Do you want to plot the cumulative density function? Default = FALSE (for probability density function).

ci

(Optional) Specify desired confidence level for confidence interval as a percentage. Set ci=FALSE to suppress CI table (default: 95)

digits

(Optional) Number of digits after decimal to display in CI table (default: 3)

printC

(Optional) Do you want to sampling distribution plot to .html file in working directory? (default: FALSE)

Value

None (makes a plot)

RCPA3 Package Tutorial Videos

Textbook References

Online Resources

Examples

 
  library(RCPA3)

  
  # based on normal distributions
  sampdistC(stat=10, se=1)
  sampdistC(stat=10, se=1, plot.cdf=TRUE)
  
  # based on t-distribution with 15 degrees of freedom
  sampdistC(stat=8, se=2, t.df=15)
  sampdistC(stat=8, se=2, t.df=15, plot.cdf=TRUE)
  

[Package RCPA3 version 1.2.1 Index]