Learn R Programming

sglOptim (version 1.0.122.0)

create.sgldata: Create a sgldata object

Description

Creates a sgldata object from a design matrix and an optional response vector or matrix.

Usage

create.sgldata(x, y, weights = rep(1/nrow(x), nrow(x)),
    sampleGrouping = NULL, group.names = NULL,
    sparseX = is(x, "sparseMatrix"))

Arguments

x
the design matrix, a matrix of size $N \times p$ (will be parsed to the loss module as X).
y
the responses, NULL, a vector or a matrix (will be parsed to the loss module as Y)..
weights
sample weights, a vector of length $N$ (will be parsed to the loss module as W).
sampleGrouping
grouping of samples, a factor of length $N$ (will be parsed to the loss module as G). Default is no grouping (NULL), that is all samples is the same group.
group.names
a vector with the names of the parameter groups (the length must equal the number of rows in the $\beta$ matrix).
sparseX
if TRUE x will be treated as sparse, if FALSE x will be treated as dens.

See Also

Other sgldata: prepare.args, prepare.args.sgldata, rearrange.sgldata