Given the summarized data provided, this function compute the hypothesis matrices used in several multivaraite statistics.
hyp_matrix( obj, par.mat = NULL, cov.mat = NULL, sample.size = NULL, groups = NULL )
A list of ANOVA R objects or linear/non-linear model objects. If "obj" is not given, then the parmeters 'par.mat', 'cov.mat', and 'sample.size' must be given.
A matrix where each column contains the model parameters of each curve.
List of parameter variance-covariance matrices.
Vector with the sample sizes used to estimate each models.
list of sets of indices that identify models from a same group.
To perform the comparison of a model under different parameter values (different curve fits with the same model), the covariance matrices and means from each set of model parameters can be used in place of the covariance matrices and means for the variables inside of each group.
A list carrying the following matrices and numerical data is returned:
"Pooled" sums of squares and cross product (SSCP) matrix: 'E'
Degree of freedom for matrix E: 'df.e'
The hypothesis SSCP matrix: 'H'
Degree of freedom for matrix H: 'df.h'
'H + E': 'HpE.inv'
Error covariance matrix: 'Se'
Inverse of Se: Se.inv
Sum of mean of Squares: 'W'
Inverse of W: 'W.inv'
Variance-covariance matrix from each model: 'Cov'
Parameter matrix for the groups: 'par'
Number of variables or model parameters: 'p'
Total sample size: 'N'
Number of models/groups: 'n'
Sample size: 'm'
Robersy Sanchez (https://genomaths.com).
## Generate a dataset set.seed(1230) x1 <- rnorm(1e3, mean = 2.5, sd = 1) x2 <- rnorm(1e3, mean = 2.5, sd = 1) line_1 <- 2.5 * x1 + 3 + runif(length(x1))/10 line_2 <- 2.5 * x2 + 3 + runif(length(x1))/10 ## Fitting the linear models lm_1 <- lm(line_1 ~ x1) lm_2 <- lm(line_2 ~ x2) res <- hyp_matrix(obj = list(model1 = lm_1, model2 = lm_2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.