Description Usage Arguments Value Note See Also Examples

A function to calculate the difference between the means of a continuous variable for two groups.

1 | ```
compareMean(formula, data = parent.frame(), ...)
``` |

`formula` |
a formula |

`data` |
a data frame in which |

`...` |
other arguments |

the difference in means between the second and first group

This function is now defunct. Use `diffmean()`

instead.

`do()`

, `compareProportion()`

and `shuffle()`

1 2 3 4 5 6 7 8 9 10 11 | ```
if (require(mosaicData)) {
data(HELPrct)
# calculate the observed difference
mean(age ~ sex, data=HELPrct)
obs <- diffmean(age ~ sex, data=HELPrct); obs
# calculate the permutation distribution
nulldist <- do(100) * diffmean(age ~ shuffle(sex),
data=HELPrct)
histogram(~ diffmean, groups=(diffmean >= obs), nulldist,
xlab="difference in means")
}
``` |

ProjectMOSAIC/mosaic documentation built on Aug. 19, 2018, 9:14 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.