sample_size_plot: Sample Size

Description Usage Arguments Details Examples

Description

Tests appropriateness of sample size for Monte Carlo simulation

Usage

1

Arguments

x

array containing predictions of a quantity, such as z0, for a cross section

Details

Creates histograms of z0 and A0 estimates vs. sample size for several exposure levels

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
exp_dir <- "/Volumes/HD3/Cross_Sections/pool_21_ra_10km_nr_3_spacing_5_sampling_even_MC_replicates_500"
n_exp_levels <- 19
expo <- seq(0.05, 0.95, length.out = n_exp_levels)
MM <- c(5,10,50,100) # number of replicates
r <- 1
k <- 4
z0.l <- vector(length = 4, "list")
par(mfrow = c(2,2))
for (i in 1:4)
{
  M <- MM[i]
  pred_lf <- pred_linear_par(r) # assumes you've already got the fitted models with the appropriate number of replicates
  z0.l[[i]] <- pred_lf$z0
  sample_size_plot(z0.l[[i]][k,], 
                   main = paste("z0", M, "replicates", 100*expo[k], "percent exposure"),"fd")
}

jschap1/WSEw documentation built on May 12, 2019, 10:50 a.m.