calcPHatConfidenceIntervals: calcPHatConfidenceIntervals

View source: R/NPSimulation.R

calcPHatConfidenceIntervalsR Documentation

calcPHatConfidenceIntervals

Description

This functions is a helper function. It assesses the significance one-sided and two-sided statistical of the probability of superiority based on its confidence interval. The type of test and the direction of the test is determined by the parameter alternative which takes one of the values 'two.sided', 'greater' or 'less'.

Usage

calcPHatConfidenceIntervals(
  phat,
  phat.variance,
  phat.df,
  alpha = 0.05,
  alternative = "two.sided"
)

Arguments

phat

This is the value of the probability of superiority.

phat.variance

This is the estimated variance of the probability of superiority.

phat.df

The degrees of freedom associated with phat value.

alpha

This is the alpha level required for the statistical tests (default 0.05)

alternative

This defines whether a one-sided test or a two-sided (i.e. default) test is required. For a one-sided test use parameter values greater' or 'less' to define whether the phat-value should be greater or less than 0.5.

Value

The function returns a Boolean variable identifying whether the effect size is significant and the confidence interval bounds.

Author(s)

Barbara Kitchenham and Lech Madeyski

Examples

reproducer:::calcPHatConfidenceIntervals(.65,0.005,8)
# A tibble: 1 x 5
#  phat.test pvalue phat.sig phat.ci.lower phat.ci.upper
#     <dbl>  <dbl> <lgl>            <dbl>         <dbl>
# 1      2.12 0.0667 FALSE            0.487         0.813
reproducer:::calcPHatConfidenceIntervals(.65,0.005,8,alternative='greater')
# A tibble: 1 x 5
#  phat.test pvalue phat.sig phat.ci.lower phat.ci.upper
#      <dbl>  <dbl> <lgl>            <dbl>         <dbl>
# 1      2.12 0.0333 TRUE             0.519             1

reproducer documentation built on Oct. 18, 2023, 5:10 p.m.