var.weight: Maximum variance weights

Description Usage Arguments Examples

View source: R/var.weight.R

Description

var.weight produces a set of weights that maximizes the total weighted variance of the distribution of different biomarkers within each subject.

Usage

1
var.weight(X, method = c("optim", "mosek"))

Arguments

X

n by p maxtrix containing observations of p biomarkers of n subjects.

method

optim (default) using R constrOptim function from stats package for optimization, mosek using mosek function from Rmosek package for optimization

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(MASS)
# a three biomarkers dataset generated from independent normal(0,1)
X = mvrnorm(n = 100, mu=rep(0,3), Sigma=diag(3), tol = 1e-6, empirical = FALSE, EISPACK = FALSE)
# compute maximum variance weights using constrOptim for optimization
var.weight(X)

## Not run: 
# need mosek installed
# compute maximum variance weights using mosek for optimization
library(Rmosek)
var.weight(X,'mosek')

## End(Not run)

mdw documentation built on July 1, 2020, 10:27 p.m.

Related to var.weight in mdw...