A function for internal use. Its main job is to be called by MarginalCor
,
and do the technical work for calculating estimated marginal correlations. It
uses R. A. Fisher's classic r-to-z transform to create confidence
intervals for the correlations. This process is explained
in easy-to-follow detail by David Shen and Zaizai Lu in a technical report.
marginal.cor.funeigen(object, id, response, alpha = 0.05)
An object of type funeigen
.
The vector of subject id's. These tell which responses in response
correspond to which curves in object
.
The vector of responses
The alpha level for confidence intervals (one minus the two-sided coverage)
Returns a data.frame
with four columns.
The first, time
, is the time index of the rows.
That is, it is a grid of points t along the time axis and
these points correspond to the rows. The next three are the
lower bound, best estimate, and upper bound, of the
correlation between the smoothed value of the covariate x(t)
and the response y at each of the time points t.
We refer to the correlation function estimated here as marginal because
it ignores any other functional covariates (rather than
trying to adjust or control for them).
Shen, D., and Lu, Z. (2006). Computation of correlation coefficient and its confidence interval in SAS (r). SUGI 31 (March 26-29, 2006), paper 170-31. Available online at https://support.sas.com/resources/papers/proceedings/proceedings/sugi31/170-31.pdf.