Skip to contents

Generate seminr PLS-SEM syntax

Usage

seminr_syntax(model, data_name = "data", nboot = NULL, seed = 123)

Arguments

model

An sf_model() object of type "pls_sem".

data_name

Name of the data object in generated R code.

nboot

Number of bootstrap samples.

seed

Random seed for bootstrap syntax.

Value

An R syntax string for seminr.

Examples

m <- sf_model(
  "pls1", type = "pls_sem",
  constructs = list(
    sf_construct("sq", items = c("sq_1", "sq_2", "sq_3")),
    sf_construct("sat", items = c("sat_1", "sat_2"))
  ),
  paths = list(sf_path("sq", "sat"))
)
cat(seminr_syntax(m))
#> # seminr PLS-SEM syntax generated by surveyframe
#> rlang::check_installed("seminr", reason = "to fit PLS-SEM models")
#> library(seminr)
#> 
#> measurement_model <- constructs(
#>   composite("sq", multi_items("sq_", 1:3)),
#>   composite("sat", multi_items("sat_", 1:2))
#> )
#> 
#> structural_model <- relationships(
#>   paths(from = "sq", to = c("sat"))
#> )
#> 
#> pls_model <- estimate_pls(
#>   data = data,
#>   measurement_model = measurement_model,
#>   structural_model = structural_model
#> )
#> 
#> boot_model <- bootstrap_model(
#>   seminr_model = pls_model,
#>   nboot = 5000,
#>   cores = 1,
#>   seed = 123
#> )
#> 
#> # Measurement assessment: reliability, AVE, and HTMT discriminant validity
#> model_summary <- summary(pls_model)
#> model_summary$reliability
#> model_summary$validity$htmt
#> 
#> # Bootstrapped structural paths
#> boot_summary <- summary(boot_model)
#> boot_summary$bootstrapped_paths