R/test_mdiff_one.R

Defines functions test_mdiff_one

test_mdiff_one <- function() {

  # Check - pen group from pen/latop in esci in excel, summary two
  estimate <- estimate_mdiff_one(
    comparison_mean = 6.88,
    comparison_sd = 4.22,
    comparison_n = 48,
    reference_mean = 6
  )
  # Should give 0.88 95% CI [-0.3453603, 2.10536]


  pen_transcription <- c(
    12.1	,
    6.5	,
    8.1	,
    7.6	,
    12.2	,
    10.8	,
    1	,
    2.9	,
    14.4	,
    8.4	,
    17.7	,
    20.1	,
    2.1	,
    11.1	,
    11.2	,
    10.7	,
    1.9	,
    5.2	,
    9.7	,
    5.2	,
    2.4	,
    7.1	,
    8.7	,
    8	,
    11.3	,
    8.5	,
    9.1	,
    4.5	,
    9.2	,
    13.3	,
    18.3	,
    2.8	,
    5.1	,
    12.4
  )

  # Check via vector
  mdiff_one <- estimate_mdiff_one(
    outcome_variable = pen_transcription
  )

  pen_data <- data.frame(
    transcription = pen_transcription,
    other = rnorm(34, 100, 15)
  )

  estimate_mdiff_one(pen_data, transcription)

  estimate_mdiff_one(pen_data, c("transcription", "other"), reference_mean = 10)

  test_describe <- c(
    99	,
    93	,
    77	,
    88	,
    92	,
    94	,
    78	,
    79	,
    83	,
    82	,
    55	,
    44	,
    66	,
    86	,
    76	,
    78	,
    79	,
    76	,
    94	,
    91	,
    90	,
    84	,
    89	,
    79	,
    81	,
    80	,
    99	,
    93	,
    77	,
    88	,
    92	,
    94	,
    78	,
    79	,
    83	,
    82	,
    97	,
    94	,
    99	,
    100	,
    79	,
    91	,
    89	,
    87	,
    89	,
    90	,
    93	,
    95	,
    94	,
    96	,
    98	,
    99	,
    83	,
    82	,
    97	,
    94	,
    99	,
    100	,
    79	,
    91	,
    89	,
    87	,
    89	,
    90	,
    97	,
    88	,
    92	,
    94	,
    78	,
    79	,
    83	,
    82	,
    55	,
    44	,
    66	,
    86	,
    76	,
    78	,
    79	,
    76	,
    94	,
    91	,
    90	,
    84	,
    89	,
    79	,
    81	,
    80	,
    99	,
    93	,
    77	,
    88	,
    92	,
    94	,
    78	,
    79	,
    83	,
    82	,
    97	,
    94	,
    99	,
    100	,
    79	,
    91	,
    89	,
    87	,
    89	,
    90	,
    93	,
    95	,
    94	,
    96	,
    98	,
    99	,
    83	,
    82	,
    97	,
    94	,
    99	,
    100	,
    79	,
    91	,
    89	,
    87	,
    89	,
    90	,
    97	,
    33	,
    44	,
    55	,
    66	,
    12	,
    14	,
    24	,
    34	,
    43	,
    54	,
    36	,
    76	,
    45	,
    34	,
    53	,
    42	,
    22	,
    34	,
    47	,
    76	,
    57	,
    78	,
    43	,
    45	,
    46	,
    76	,
    23	,
    43	,
    55	,
    66	,
    87	,
    78	,
    97	,
    67	,
    68	,
    69	,
    56	,
    51	,
    60	,
    70	,
    50	,
    40	,
    54	,
    33	,
    23	,
    32	,
    76	,
    70	,
    98	,
    87	,
    79	,
    75	,
    74	,
    73	,
    72	,
    27	,
    45	,
    41	,
    16	,
    52	,
    35	,
    47	,
    87	,
    86	,
    58	,
    74	,
    87	,
    69	,
    8	,
    7	,
    25	,
    13	,
    11

  )

  estimate <- estimate_magnitude(outcome_variable = test_describe)

  plot_describe(estimate, mark_percentile = .99, type = "dotplot")

}
rcalinjageman/esci4 documentation built on May 18, 2023, 4:01 a.m.