Description Usage Arguments Value Author(s) See Also Examples
This function checks whether a variable is constant or varying
withing blocks of a block-format
data set. A variable
is constant if it takes the same value at each position within a
block. It is varying if it takes more than one distinct value
within a block.
1 2 | blk.isConstant(x, id, ind = NULL)
blk.isVarying(x, id, ind = NULL)
|
x |
A vector in |
id |
A valid |
ind |
A vector of logicals used to filter the values of |
A logical.
Ben Rich <benjamin.rich@certara.com>
block-format
blk.applyNto1
nunique
1 2 3 4 5 6 7 8 9 10 11 | require(nlme)
data(Phenobarb)
dat <- Phenobarb[1:56,] # First 4 subjects
attach(dat)
blk.isConstant(Wt, asID(Subject)) # TRUE
blk.isConstant(Apgar, asID(Subject)) # TRUE
blk.isConstant(dose, asID(Subject)) # FALSE
blk.isConstant(dose, asID(Subject), ind=(!is.na(dose) & time > 0)) # TRUE
detach(dat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.