vfaggregate | R Documentation |
vfaggregate
computes summary statistics of visual field data
vfmean
computes the mean statistics of visual field data. It is
a wrapper for vfaggregate but only to compute means
vfretestdist
computes the conditional distribution from test-retest data
vfaggregate(vf, by = "date", fun = mean, ...) vfmean(vf, by = "date", ...) vfretestdist(vf, nbase = 1, nfollow = 1, alpha = 0.1, ...)
vf |
a table with visual fields data. Data is rounded, which leaves sensitivity data unchanged, but it is necessary for the nature of the algorithm if the data passed are TD or PD values or summary stats such as averages. Beware of the locations in the blind spot, which very likely need to be removed |
by |
aggregate by |
fun |
a function to compute the summary statistics which can be applied to
all data subsets. The default is ' |
... |
arguments to be passed to or from methods. A useful one to try
is type of quantile calculation ' |
nbase |
number of visual fields to be used as baseline |
nfollow |
number of visual fields to be used as follow up |
alpha |
significance level to derive the conditional retest intervals.
Default value is |
vfaggregate
this is a restricted version of aggregate
that only allows to use part of the key hierarchically, and operates on all
data frames of the VisualField
object. The restriction is that only
aggregates that are allowed are 'newkey = c("id", "eye")
' and
'newkey = c("id", "eye", "date")
'. It returns the aggregated value for all
numeric columns grouped and ordered by the new key (id and eye, or id, eye,
and date). If the aggregate grouping is by eye
and the function, then
the date
returned is the average.
vfaggregate
and vfmean
return a vf data frame with aggregate values
vfretestdist
returns a list with the following elements:
x
with all the test values (x-axis)
y
the distribution of retest dB values conditional to each
test value in x
. It is a list with as many entries as x
n
number of retest values conditional to each value in x
.
It is a list with as many entries as x
ymed
median for each value in x
. It is a list with as
many entries as x
ylow
quantile value for significance 1 - alpha / 2
for each value in x
. It is a list with as many entries as x
yup
quantile value for significance alpha / 2
for each value in x
. It is a list with as many entries as x
Together ylow
and yup
represent the lower and upper limit of the
(1 - alpha)%
confidence intervals at each value x
.
# aggregate by date vfaggregate(vfpwgRetest24d2, by = "date") # compute the mean vfaggregate(vfpwgRetest24d2, by = "date", fun = sd) # compute standard deviation # aggregate by eye vfaggregate(vfpwgRetest24d2, by = "eye") # compute the mean vfaggregate(vfpwgRetest24d2, by = "eye", fun = sd) # compute standard deviation # mean by date vfmean(vfpwgRetest24d2, by = "date") # mean by eye vfmean(vfpwgRetest24d2, by = "eye") # get the retest sensitivity data after removing the blind spot retest <- vfretestdist(vfpwgRetest24d2, nbase = 1, nfollow = 1) plot(0, 0, typ = "n", xlim = c(0, 40), ylim = c(0,40), xlab = "test in dB", ylab = "retest in dB", asp = 1) for(i in 1:length(retest$x)) { points(rep(retest$x[i], length(retest$y[[i]])), retest$y[[i]], pch = 20, col = "lightgray", cex = 0.75) } lines(c(0,40), c(0,40), col = "black") lines(retest$x, retest$ymed, col = "red") lines(retest$x, retest$ylow, col = "red", lty = 2) lines(retest$x, retest$yup, col = "red", lty = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.