From be5318b15c2003ccc8e113cd069a8c465e853e4c Mon Sep 17 00:00:00 2001 From: CharlesEtienneLavoie Date: Wed, 8 May 2024 15:16:19 -0400 Subject: [PATCH] update documentation --- NAMESPACE | 1 + man/extract_power.Rd | 33 +++++++++++++++++++++++++++++++++ man/notes.R | 11 +++++++++++ 3 files changed, 45 insertions(+) create mode 100644 man/extract_power.Rd diff --git a/NAMESPACE b/NAMESPACE index 23defcf..5c99c5d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,6 +6,7 @@ export(clean_ending) export(clean_env) export(clean_na) export(clean_speed) +export(extract_power) export(get_base_names) export(get_files) export(get_git_packages) diff --git a/man/extract_power.Rd b/man/extract_power.Rd new file mode 100644 index 0000000..61face7 --- /dev/null +++ b/man/extract_power.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/extract_power.R +\name{extract_power} +\alias{extract_power} +\title{Extract Power Analysis Results} +\usage{ +extract_power(data, target) +} +\arguments{ +\item{data}{A dataframe containing the results of SEM simulations, typically produced by a function like \code{simulate_power}. It should include parameters estimates, p-values, and confidence intervals.} + +\item{target}{A vector of strings specifying which parameters (paths) to analyze for power. These should match entries in the 'Parameter' column of the \code{data}.} +} +\value{ +A dataframe summarizing the power analysis results for specified paths. Each row corresponds to a path with the following columns: +\itemize{ +\item{Value}{Mean estimate of the path coefficient across simulations.} +\item{Median}{Median estimate of the path coefficient.} +\item{Power}{Proportion of simulations where the path was statistically significant (p < 0.05), excluding NA values.} +\item{\verb{Power (All Cases)}}{Proportion of simulations where the path was significant, treating NAs as non-significant.} +\item{CI_lower}{Average lower bound of the confidence interval for the path estimate.} +\item{CI_upper}{Average upper bound of the confidence interval for the path estimate.} +} +} +\description{ +This function calculates the statistical power of SEM models based on simulation results, providing a detailed summary including the convergence rate of simulations. +} +\examples{ +# Assume 'sim_results' is a dataframe from simulate_power() +target_paths <- c("M ~ X", "Y ~ M") +power_summary <- extract_power(sim_results, target_paths) + +} diff --git a/man/notes.R b/man/notes.R index 64e803d..b0a442e 100644 --- a/man/notes.R +++ b/man/notes.R @@ -17,3 +17,14 @@ usethis::use_git_remote("origin", url = 'https://github.com/CharlesEtienneLavoie ?usethis #test + + +use_github_links() + + +usethis::gh_token_help() + +create_github_token() + +gitcreds::gitcreds_set() +