clusterQp {Qindex} | R Documentation |
Cluster-Specific Sample Quantiles
Description
Obtain vectors of sample quantiles in each cluster of observations
Usage
clusterQp(
formula,
data,
exclude,
from = 0.01,
to = 0.99,
by = 0.01,
type = 7,
...
)
Arguments
formula |
formula passed to aggregate.formula.
To calculate the cluster-specific statistics
for response
|
data |
|
exclude |
(optional) formula or character vector,
(supposedly non-cluster-specific) variables to be excluded from aggregation.
To remove variables
|
from , to , by |
double scalars,
the starting, end, and increment values
to specify a sequence of probabilities
|
type |
|
... |
additional parameters, currently not in use |
Details
Function clusterQp()
calculates N
sample quantiles
in each aggregated cluster of observations.
The aggregation is specified by parameters formula
and exclude
.
Value
Function clusterQp()
returns an aggregated data.frame.
A double matrix of N
columns is created to store
the sample quantiles q
of each aggregated cluster.
The column names of this quantile matrix are the probabilities p
.
Examples
Ki67q = clusterQp(Marker ~ ., data = Ki67, exclude = c('tissueID','inner_x','inner_y'))
tmp = clusterQp(Marker ~ ., data = Ki67, exclude = . ~ . - tissueID - inner_x - inner_y)
# stopifnot(identical(Ki67q, tmp))
# stopifnot(!anyDuplicated.default(Ki67q$subjID))
head(Ki67q)
sapply(Ki67q, FUN = class)