Learn R Programming

normref (version 0.0.0.1)

composite_shape: Shape data for a composite scale based on normalized Z-scores

Description

composite_shape() creates a data.frame with age values and the sum of normalized z-scores from multiple NormTable objects, suitable for use as input to fb_select().

Usage

composite_shape(normtables)

Value

A data.frame with:

  • age: Age values from the first NormTable

  • z_sum: Unweighted sum of normalized z-scores across all objects

Arguments

normtables

list of NormTable objects created by normtable_create(). Each must contain znorm_sample and norm_sample.

See Also

shape_data(), fb_select(), normtable_create()

Examples

Run this code
# \donttest{
invisible(data("ids_data"))

# Example with two normtables
mydata1 <- shape_data(ids_data, age_name = "age", score_name = "y7", family = "BCPE")
mod1 <- fb_select(mydata1, age_name = "age", score_name = "shaped_score",
                  family = "BCPE", selcrit = "BIC")
norm1 <- normtable_create(mod1, mydata1, age_name = "age", score_name = "shaped_score")

mydata2 <- shape_data(ids_data, age_name = "age", score_name = "y14", family = "BCPE")
mod2 <- fb_select(mydata2, age_name = "age", score_name = "shaped_score",
                  family = "BCPE", selcrit = "BIC")
norm2 <- normtable_create(mod2, mydata2, age_name = "age", score_name = "shaped_score")

composite_data <- composite_shape(list(norm1, norm2))# }

Run the code above in your browser using DataLab