Learn R Programming

statpsych (version 1.7.0)

power.cor: Approximates the power of a correlation test for a planned sample size

Description

Computes the approximate power of a test for a population Pearson or partial correlation test for a planned sample size. Set s = 0 for a Pearson correlation.

Usage

power.cor(alpha, n, cor, h, s)

Value

Returns the approximate power of the test

Arguments

alpha

alpha level for hypothesis test

n

planned sample size

cor

planning value of correlation

h

null hypothesis value of correlation

s

number of control variables

Examples

Run this code
power.cor(.05, 80, .3, 0, 0)

# Should return:
#     Power
# 0.7751947


Run the code above in your browser using DataLab