Description Usage Arguments Value See Also Examples
Calculates the observed values of the adjacent dependence ratios from the data.
1 2 |
formula |
the syntax is of form |
data |
optional data frame containing the variables in the formula |
subset |
an optional vector specifying a subset of observations from the data |
ord |
order of the dependence ratios to be calculated. The default is 2 |
boot.ci |
logical argument specifying whether bootstrap confidence intervals will be calculated for the empirical dependence ratio estimates |
n.boot |
number of bootstrap replicates |
ci.width |
width of the confidence interval. Default is 0.95 |
An object of class depratio
. Generic functions
print
and plot
are also available.
An object of class depratio
is a list containing at least the
following two components:
tau |
matrix of the observed dependence ratios |
freq |
matrix of the frequencies of events for the numerator of the observed dependence ratios |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## calculate and plot the observed 2nd order dependence ratios
## for the marijuana data:
data(marijuana)
dr.male <- depratio(y~cluster(id)+Time(age), data=marijuana,
subset=sex=="male")
dr.male
plot(dr.male)
## confirm that the 1st order Markov assumption is adequate
## for the madras data:
data(madras)
dr2 <- depratio(symptom~cluster(id)+Time(month), data=madras)
dr3 <- depratio(symptom~cluster(id)+Time(month), ord=3, data=madras)
dr <- rbind(dr2$tau[-length(dr2$tau)]*dr2$tau[-1], dr3$tau)
matplot(1:ncol(dr), t(dr))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.