Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion R/wilcoxonsr_hodges_lehman.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,38 @@ DOS2::senWilcox(
- Gamma \>= 1 is the value of the sensitivity parameter. If gamma=1, then you are assuming ignorable treatment assignment or equivalently no unmeasured confounding - that is the considered scenario in our example, sensitivity analysis is not performed.
- Only p value, estimate and CI are provided

### Coin package - coming soon! {.unnumbered}
#### Coin {.unnumbered}

### Examples {.unnumbered}

```{r}
# Exact
# Default method of handling zeros - Pratt (1959):
coin::wilcoxsign_test(blood_p$bp_after~blood_p$bp_before,
zero.method = "Pratt",
distribution = "exact")

# Wilcoxon (1949) method of handling zeros
# the same results for datasets with no ties and no 0s
coin::wilcoxsign_test(blood_p$bp_after~blood_p$bp_before,
zero.method = "Wilcoxon",
distribution = "exact")

# Asymptotic approximation & No continuity correction
coin::wilcoxsign_test(blood_p$bp_after~blood_p$bp_before,
zero.method = "Pratt",
distribution = "asymptotic")

# Monte Carlo resampling (& No continuity correction)
coin::wilcoxsign_test(blood_p$bp_after~blood_p$bp_before,
zero.method = "Pratt",
distribution = "approximate")



```

### Important notes on coin::wilcoxsign_test {.unnumbered}
- Only p value, Statistic V and estimate are provided, no H-L CI is calculated
- The default method of handling zeros (Pratt), first rank-transforms the absolute differences (with zeros) and then discards the ranks corresponding to the zero-differences. The alternative one (Wilcoxon) first discards the zero-differences and then rank-transforms the remaining absolute differences
- No continuity correction is applied and there is no option to change that
Loading