predict_codalm: Prediction for Transformation-free Linear Regression for...

Description Usage Arguments Value Examples

View source: R/codalm_em.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
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),])

codalm documentation built on July 27, 2021, 1:07 a.m.