run_scenarios: Run different scenarios on the survey data based on the model...

Description Usage Arguments Examples

View source: R/run_scenarios.R

Description

Run different scenarios on the survey data based on the model output from model_survey()

Usage

1
2
run_scenarios(model, scenarios = make_scenarios(model),
  variables_column = FALSE, descending = TRUE)

Arguments

model

Model object from model_survey()

scenarios

A data frame of scenarios

variables_column

Should the table output have a variables column

descending

Should the table be in descending order by expected_NPS (scenarios will be renumbered)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(NPS)
library(NPSdrivers)
library(dplyr)

data(survey_sim)

survey_sim <- survey_sim %>%
  mutate(NPC = factor(npc(recommend), ordered = TRUE)) %>%
  select(-recommend)

m <- model_survey(survey_sim)
scenario_results <- run_scenarios(m)

NateByers/NPSdrivers documentation built on May 6, 2019, 10:12 a.m.