fit_preference_summary: Fit Preference Model from Summary Data

Description Usage Arguments References Examples

View source: R/analyze-preference-data.r

Description

Computes the test statistics and p-values for the preference, selection, and treatment effects in a two-stage randomized trial using summary data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
fit_preference_summary(
  x1mean,
  x1var,
  m1,
  x2mean,
  x2var,
  m2,
  y1mean,
  y1var,
  n1,
  y2mean,
  y2var,
  n2,
  xi = 1,
  nstrata = 1,
  alpha = 0.05
)

Arguments

x1mean

mean of responses for patients choosing treatment 1. If study is stratified, should be vector with length equal to the number of strata.

x1var

variance of responses for patients choosing treatment 1. If study is stratified, should be vector with length equal to the number of strata.

m1

number of patients choosing treatment 1. If study is stratified, should be vector with length equal to the number of strata.

x2mean

mean of responses for patients choosing treatment 2. If study is stratified, should be vector with length equal to the number of strata.

x2var

variance of responses for patients choosing treatment 2. If study is stratified, should be vector with length equal to the number of strata.

m2

number of patients choosing treatment 2. If study is stratified, should be vector with length equal to the number of strata.

y1mean

mean of responses for patients randomized to treatment 1. If study is stratified, should be vector with length equal to the number of strata.

y1var

variance of responses for patients randomized to treatment 1. If study is stratified, should be vector with length equal to the number of strata.

n1

number of patients randomized to treatment 1. If study is stratified, should be vector with length equal to the number of strata.

y2mean

mean of responses for patients randomized to treatment 2. If study is stratified, should be vector with length equal to the number of strata.

y2var

variance of responses for patients randomized to treatment 2. If study is stratified, should be vector with length equal to the number of strata.

n2

number of patients randomized to treatment 2. If study is stratified, should be vector with length equal to the number of strata.

xi

a numeric vector of the proportion of patients in each stratum. Length of vector should equal the number of strata in the study and sum of vector should be 1. All vector elements should be numeric values between 0 and 1. Default is 1 (i.e. unstratified design).

nstrata

number of strata. Default is 1 (i.e. unstratified design).

alpha

Type I error rate, used to determine confidence interval level for the effect estimates. Default is 0.05 (i.e. 95% confidence interval)

References

Rucker G (1989). "A two-stage trial design for testing treatment, self-selection and treatment preference effects." Stat Med, 8(4):477-485. (PubMed)

Cameron B, Esserman D (2016). "Sample Size and Power for a Stratified Doubly Randomized Preference Design." Stat Methods Med Res. (PubMed)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Unstratified

x1mean <- 5
x1var <- 1
m1 <- 15
x2mean <- 7
x2var <- 1.1
m2 <- 35
y1mean <- 6
y1var <- 1
n1 <- 25
y2mean <- 8
y2var <- 1.2
n2 <- 25
fit_preference_summary(x1mean, x2var, m1, x2mean, x2var, m2, y1mean, y1var,
               n1, y2mean, y2var, n2)

# Stratified

x1mean <- c(5, 3)
x1var <- c(1, 1)
m1 <- c(15, 30)
x2mean <- c(7, 7)
x2var <- c(1.1, 3.1)
m2 <- c(35, 40)
y1mean <- c(6, 4)
y1var <- c(1, 2)
n1 <- c(25, 35)
y2mean <- c(8, 12)
y2var <- c(1.2, 1)
n2 <- c(25, 20)
fit_preference_summary(x1mean, x2var, m1, x2mean, x2var, m2, y1mean, y1var,
                       n1, y2mean, y2var, n2, alpha=0.1)

kaneplusplus/preference documentation built on Sept. 12, 2020, 12:37 p.m.