Convert series or group to a matrix object after removing NAs.

Series-TO-Matrix object: convert the data in a series or group or series into a matrix after removing rows with missing values.

Syntax

stom(o1, o2, smp)

where o1 is a series, alpha, or group, o2 is a corresponding vector, svector, or matrix, and smp is an optional sample.

• If o1 is a series, stom fills the vector o2 with data from the o1 using the optional sample object smp or the workfile sample. o2 will be resized accordingly. If any observation has the value “NA”, the observation will be omitted from the vector.

• If o1 is a group, stom fills the matrix o2 with data from o1 using the optional sample object smp or the workfile sample. o2 will be resized accordingly. The series in o1 are placed in the columns of o2 in the order they appear in the group spreadsheet. If any of the series in the group has the value “NA” for a given series observation or blank for an alpha, the observation will be omitted for all series.

• If o1 is an alpha-series, stom fills the svector o2 with data from o1 using the optional sample object smp or the workfile sample. o2 will be resized accordingly. If any of the observation is blank, the observation will be omitted from the result.

For a conversion method that preserves NAs, see
stomna.

Examples

stom(ser1,v1)

stom(ser1,v2,smp1)

stom(grp1,m1)

stom(grp1,m2,smp1)

Cross-references