glr | R Documentation |
Functions that compute global and pointwise linear regression analyses:
glr
performs global linear regression analysis
plr
performs pointwise linear regression (PLR) analysis
poplr
performs PoPLR analysis as in O'Leary et al (see reference)
glr(g, testSlope = 0)
plr(vf, testSlope = 0)
poplr(vf, testSlope = 0, nperm = factorial(7), trunc = 1)
g |
a data.frame with date on the first column and the value of the global index on the second column |
testSlope |
slope, or slopes, to test as null hypothesis. Default is 0.
if a single value, then the same null hypothesis is used for all locations.
If a vector of values, then (for |
vf |
visual fields sensitivity data |
nperm |
number of permutations. If the number of visits is 7 or less, then
|
trunc |
truncation value for the Truncated Product Method (see reference) |
poplr
there is a small difference between this implementation of
PoPLR and that proposed by O'Leary et al. The combined S statistic in the
paper used a natural logarithm. Here we not only use a logarithm of base 10
but we also divide by the number of locations. This way the S statistic has
a more direct interpretation as the average number of leading zeros in the
p-values for pointwise (simple) linear regression. That is, if S = 2, then
the p-values have on average 2 leading zeros, if S = 3, then 3 leading zeros,
and so on
glr
and plr
return a list with the following
id
patient ID
eye
patient eye
testSlope
slope for glr
or list of slopes for plr
to test as null hypotheses
nvisits
number of visits
years
years from baseline. Used for the pointwise linear
regression analysis
data
data analyzed. For glr
, it is the values of the
global indes analyzed. For plr
, each column is a location of the
visual field used for the analysis. Each row is a visit (as many as years)
pred
predicted values. Each column is a location of the visual
field used for the analysis. Each row is a visit (as many as years)
sl
slopes estimated at each location for pointwise (simple)
linear regression
int
intercept estimated at each location for pointwise (simple)
linear regression
tval
t-values obtained for the left-tailed-t-tests for the slopes
obtained in the pointwise (simple) linear regression at each location
pval
p-values obtained for the left-tailed t-tests for the slopes
obtained
poplr
returns a list with the following additional fields
csl
the modified Fisher's S-statistic for the left-tailed permutation test
cslp
the p-value for the left-tailed permutation test
csr
the modifed Fisher's S-statistic for the right-tailed permutation test
csrp
the p-value for the right-tailed permutation test
pstats
a list with the poinwise slopes ('sl
'), intercepts
('int
'), standard errors ('se
'), and p-values ('pval
') obtained
for the series at each location analyzed and for all nperm
permutations
(in 'permutations
')
cstats
a list with all combined stats:
csl, csr
the combined Fisher S-statistics for the left- and right-tailed
permutation tests respectively
cslp, csrp
the corresponding p-values for the permutation tests
cslall, csrall
the combined Fisher S-statistics for all permutations
N. O'Leary, B. C. Chauhan, and P. H. Artes. Visual field progression in glaucoma: estimating the overall significance of deterioration with permutation analyses of pointwise linear regression (PoPLR). Investigative Ophthalmology and Visual Science, 53, 2012
vf <- vffilter(vfpwgRetest24d2, id == 1) # select one patient
res <- glr(getgl(vf)[,c("date", "tmd")]) # linear regression with mean deviation (MD)
res <- plr(gettd(vf)) # pointwise linear regression (PLR) with TD values
res <- poplr(gettd(vf)) # Permutation of PLR with TD values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.