# NOT RUN {
# Load the data
data(nca.example)
data <- nca.example
# Basic usage of the nca analysis, with independent variables in the first 2 columns
# and the dependent variable in the third column
model <- nca_analysis(data, c(1, 2), 3)
# Use nca_output to shows the summaries (see nca_output documentation for more options)
nca_output(model)
# Columns can be selected by name as well
model <- nca_analysis(data, c("Individualism", "Risk taking"), "Innovation performance")
# Define the ceiling techniques via the ceilings parameter, see 'ceilings' for all types
model <- nca_analysis(data, c(1, 2), 3, ceilings=c("ols", "ce_vrs"))
# These are the available ceiling techniques
print(ceilings)
# For using the upper right corner(s), 'flip' the x variables
model <- nca_analysis(data, c(1, 2), 3, flip.x=TRUE)
# Or just for a single x variable
model <- nca_analysis(data, c(1, 2), 3, flip.x=c(TRUE, FALSE))
# Flip the y variable if the lower corners need analysing
model <- nca_analysis(data, c(1, 2), 3, flip.x=c(TRUE, FALSE), flip.y=TRUE)
# Use a theoretical scope instead of the (calculated) empirical scope
model <- nca_analysis(data, c(1, 2), 3, scope=c(0, 120, 0, 240))
# By default the bottlenecks use percentages of the range for the x and y values.
# But using the percentage of the max value is also possible
model <- nca_analysis(data, c(1, 2), 3, bottleneck.y="percentage.max")
# Either can be set to use the actual values, in this case the x-value
model <- nca_analysis(data, c(1, 2), 3, bottleneck.x="actual")
# Or use percentile, in this case for the y-values
model <- nca_analysis(data, c(1, 2), 3, bottleneck.y="percentile")
# Of course, any combination is possible
model <- nca_analysis(data, c(1, 2), 3, bottleneck.x="actual", bottleneck.y="percentile")
# The number of steps is adjustible via the steps parameter
model <- nca_analysis(data, c(1, 2), 3, steps=20)
# Or via the step.size parameter, this ignores the steps parameter
model <- nca_analysis(data, c(1, 2), 3, step.size=5)
# Values that are outside the scope are translated to 'NA' in the bottleneck tables
# But we can also set the them to the limits set by the scope
model <- nca_analysis(data, c(1, 2), 3, cutoff=1)
# Or use the calculated values on the ceiling line
model <- nca_analysis(data, c(1, 2), 3, cutoff=2)
# }
Run the code above in your browser using DataLab