predict_codalm {codalm}R Documentation

Prediction for Transformation-free Linear Regression for Compositional Outcomes and Predictors

Description

Obtains compositional predictions for new compositional covariates using an established codalm model.

Usage

predict_codalm(object, newx)

Arguments

object

A codalm model

newx

A matrix of compositional predictors. Each row is an observation, and must sum to 1. If any rows do not sum to 1, they will be renormalized

Value

A D_s x D_r compositional coefficient matrix, where D_s and D_r are the dimensions of the compositional predictor and outcome, respectively

Examples

data("educFM")
father <- as.matrix(educFM[,2:4])
y <- father / rowSums(father)
mother <- as.matrix(educFM[,5:7] )
x <- mother/rowSums(mother)
codalm_model <- codalm(y[1:20,], x[1:20,])
predict_codalm(codalm_model, x[-(1:20),])

[Package codalm version 0.1.2 Index]