|
NAG[g02byc] NAG[nag_partial_corr] - Computes partial correlation/variance-covariance matrix from correlation/variance-covariance matrix computed by g02bxc (nag_corr_cov)
|
|
Calling Sequence
g02byc(nx, sz, r, p, 'm'=m, 'ny'=ny, 'tdr'=tdr, 'tdp'=tdp, 'fail'=fail)
nag_partial_corr(. . .)
Parameters
|
nx - integer;
|
|
|
On entry: the number of variables, , which are to be considered as fixed.
|
|
;
|
|
.
|
|
|
sz - Vector(1..m, datatype=integer[kernelopts('wordsize')/8]);
|
|
|
On entry: indicates which variables belong to set and .
|
|
sz The th variable is not included in the computations.
|
|
exactly ny elements of sz must be ,
|
|
exactly nx elements of sz must be .
|
|
|
r - Matrix(1..m, 1..tdr, datatype=float[8], order=C_order);
|
|
|
On entry: the variance-covariance or correlation matrix for the m variables as given by g02bxc (nag_corr_cov). Only the upper triangle need be given.
|
|
Note: the matrix must be a full rank variance-covariance or correlation matrix and so be positive-definite. This condition is not directly checked by the function.
|
|
|
p - Matrix(1..ny, 1..tdp, datatype=float[8], order=C_order);
|
|
|
|
'm'=m - integer; (optional)
|
|
|
Default value: the first dimension of the arrays sz, r and the second dimension of the arrays sz, rthe array r.
|
|
On entry: the number of variables in the variance-covariance/correlation matrix given in r.
|
|
Constraint: . .
|
|
|
'ny'=ny - integer; (optional)
|
|
|
Default value: the dimension of the array p.
|
|
On entry: the number of variables, , for which partial correlation coefficients are to be computed.
|
|
Constraint: . .
|
|
|
'tdr'=tdr - integer; (optional)
|
|
|
On entry: the second dimension of the array r as declared in the function from which nag_partial_corr (g02byc) is called.
|
|
Constraint: . .
|
|
|
'tdp'=tdp - integer; (optional)
|
|
|
On entry: the second dimension of the array p as declared in the function from which nag_partial_corr (g02byc) is called.
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_partial_corr (g02byc) computes a partial correlation/variance-covariance matrix from a correlation or variance-covariance matrix computed by g02bxc (nag_corr_cov).
|
|
Error Indicators and Warnings
|
|
"NE_3_INT_ARG_CONS"
On entry, , and . These arguments must satisfy .
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_NX_SET"
On entry, and there are not exactly nx values of .
"NE_BAD_NY_SET"
On entry, and there are not exactly ny values of . Number of values of .
"NE_COR_MAT_POSDEF"
Either a diagonal element of the partial variance-covariance matrix is zero and/or a computed partial correlation coefficient is greater than one. Both indicate that the matrix input in r was not positive-definite.
"NE_COR_MAT_RANK"
On entry, either the variance-covariance matrix or the correlation matrix is not of full rank. Try removing some of the nx variables by setting the appropriate elements of sz to zero.
"NE_INT_ARG_LT"
On entry, m must not be less than 3: .
"NE_INTERNAL_ERROR"
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please consult NAG for assistance.
|
|
Accuracy
|
|
nag_partial_corr (g02byc) computes the partial variance-covariance matrix, , by computing the Cholesky factorization of . If is not of full rank the computation will fail.
|
|
Further Comments
|
|
Models that represent the linear associations given by partial correlations can be fitted using the multiple regression function g02dac (nag_regsn_mult_linear).
|
|
|
Examples
|
|
>
|
m := 3:
ny := 2:
nx := 1:
tdr := 3:
tdp := 3:
sz := Vector([-1, -1, 1], datatype=integer[kernelopts('wordsize')/8]):
r := Matrix([[17053.69523809524, 152.8584285714286, 45.94742857142857], [152.8584285714286, 2.397368571428571, 0.6475057142857145], [45.94742857142857, 0.6475057142857145, 0.1793171428571429]], datatype=float[8], order='C_order'):
p := Matrix(2, 3, datatype=float[8], order='C_order'):
NAG:-g02byc(nx, sz, r, p, 'm' = m, 'ny' = ny, 'tdr' = tdr, 'tdp' = tdp):
|
|
|
See Also
|
|
Krzanowski W J (1990) Principles of Multivariate Analysis Oxford University Press
Morrison D F (1967) Multivariate Statistical Methods McGraw–Hill
Osborn J F (1979) Statistical Exercises in Medical Research Blackwell
Snedecor G W and Cochran W G (1967) Statistical Methods Iowa State University Press
g02 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|