Skip to main content

R code: Simulation-based power analysis code

Citation

Weiser, E. L., 2018, Simulation-based power analysis code: U.S. Geological Survey data release, https://doi.org/10.5066/P9SFUH2K.

Summary

This script simulates data for population surveys (e.g., the density of individuals per some unit of area) and fits a model to the simulated data to determine whether the population trend can be detected. The script tests one replicate of one scenario. This example takes lt 1 sec to run on a modern laptop computer. For each scenario, the process would be repeated over a series of replicates (e.g., 100 or 500), and then the proportion of replicates in which the trend was detected would be tallied. That proportion indicates the statistical power. Additional scenarios are then tested by changing the input parameters provided below.

Contacts

Point of Contact :
Emily L Weiser
Originator :
Emily L Weiser
Distributor :
GS ScienceBase

Attached Files

Click on title to download individual files attached to this item.

license.txt 2.6 KB text/plain
PowerAnalysis.R 4.25 KB text/x-rsrc
ReadMe.md 1.68 KB text/x-web-markdown

Purpose

This script simulates data for population surveys

Communities

  • Upper Midwest Environmental Sciences Center (UMESC)

Provenance

Data source
Input directly

Item Actions

View Item as ...

Save Item as ...

View Item...