Package: spdesign 0.0.4

Erlend Dancke Sandorf

spdesign: Designing Stated Preference Experiments

Contemporary software commonly used to design stated preference experiments are expensive and the code is closed source. This is a free software package with an easy to use interface to make flexible stated preference experimental designs using state-of-the-art methods. For an overview of stated choice experimental design theory, see e.g., Rose, J. M. & Bliemer, M. C. J. (2014) in Hess S. & Daly. A. <doi:10.4337/9781781003152>. The package website can be accessed at <https://spdesign.edsandorf.me>. We acknowledge funding from the European Union’s Horizon 2020 research and innovation program under the Marie Sklodowska-Curie grant INSPiRE (Grant agreement ID: 793163).

Authors:Erlend Dancke Sandorf [aut, cre], Danny Campbell [aut]

spdesign_0.0.4.tar.gz
spdesign_0.0.4.zip(r-4.5)spdesign_0.0.4.zip(r-4.4)spdesign_0.0.4.zip(r-4.3)
spdesign_0.0.4.tgz(r-4.4-any)spdesign_0.0.4.tgz(r-4.3-any)
spdesign_0.0.4.tar.gz(r-4.5-noble)spdesign_0.0.4.tar.gz(r-4.4-noble)
spdesign_0.0.4.tgz(r-4.4-emscripten)spdesign_0.0.4.tgz(r-4.3-emscripten)
spdesign.pdf |spdesign.html
spdesign/json (API)
NEWS

# Install 'spdesign' in R:
install.packages('spdesign', repos = c('https://edsandorf.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/edsandorf/spdesign/issues

On CRAN:

20 exports 0.93 score 27 dependencies 18 scripts 244 downloads

Last updated 3 months agofrom:c561372078. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKAug 23 2024
R-4.5-winOKAug 23 2024
R-4.5-linuxOKAug 23 2024
R-4.4-winOKAug 23 2024
R-4.4-macOKAug 23 2024
R-4.3-winOKAug 23 2024
R-4.3-macOKAug 23 2024

Exports:attribute_levelsattribute_namesblockcalculate_efficiency_criteriaclean_utilitycorexpand_attribute_levelsfull_factorialgenerate_designlevel_balancemake_drawsoccurrencespriorsprobabilitiesrep_colsrep_rowsset_default_optionsupdate_utilityutility_formulavcov

Dependencies:clicodetoolsdigestdplyrfansifuturegenericsglobalsgluelifecyclelistenvmagrittrmatrixStatsparallellypillarpkgconfigR6randtoolboxrlangrngWELLstringistringrtibbletidyselectutf8vctrswithr

Examples

Rendered fromexamples.Rmdusingknitr::rmarkdownon Aug 23 2024.

Last update: 2024-01-16
Started: 2024-01-16

Syntax

Rendered fromsyntax.Rmdusingknitr::rmarkdownon Aug 23 2024.

Last update: 2024-06-24
Started: 2021-01-08

Readme and manuals

Help Manual

Help pageTopics
Print package startup message.onAttach
Check whether all priors and attributes have specified levelsall_priors_and_levels_specified
Check whether any priors or attributes are specified with a value more than onceany_duplicates
Check whether we can achieve attribute level balanceattribute_level_balance
Generic for getting the attributes and levels from the utility functionattribute_levels
Generic for getting the attribute namesattribute_names
Block the designblock
A-errorcalculate_a_error
C-errorcalculate_c_error
D-errorcalculate_d_error
Calculate efficiencycalculate_efficiency
Calculate efficiency criteriacalculate_efficiency_criteria
S-errorcalculate_s_error
Cleans the utility expressionclean_utility
Generic for extracting the vector of priorscoef.spdesign
Check whether the utility function contains dummy coded variablescontains_dummies
Correlationcor
Cycling of attribute levelscycle
Define base x_jdefine_base_x_j
Define x_jdefine_x_j
Derive the variance covariance matrix of the designderive_vcov
Derive the variance covariance matrix for the MNL modelderive_vcov_mnl
Derive the variance covariance matrix for the RPL modelderive_vcov_rpl
Expand the sequence of integersdigitize
Find the position of the dummy coded attributesdummy_names
Evaluate the design candidateevaluate_design_candidate
Exclude rows from the candidate setexclude
Expand the list of attributes and levels to the "wide" formatexpand_attribute_levels
Extract all namesextract_all_names
Extract attribute namesextract_attribute_names
Extract distributionsextract_distribution
Extract the frequency of levelsextract_level_occurrence
Extracts the named values of the utility functionextract_named_values
Extract the parameter distributionextract_param_distribution
Extract parameter namesextract_param_names
Extract the prior distributionextract_prior_distribution
Extract specifiedextract_specified
Extract unparsed named values of the utilitiy functionextract_unparsed_values
Extract the value argument(s)extract_values
Find a design using a modified Federov algorithmfederov
Test whether a design candidate fits the constraints imposed by the level occurrencesfits_lvl_occurrences
Generate the full factorialfull_factorial
Generate an efficient experimental designgenerate_design
Generates a candidate for the RSC algorithmgenerate_rsc_candidate
Tests whether the utility expression contains Bayesian priorshas_bayesian_prior
Tests whether the utility expression contains random parametershas_random_parameter
Tests whether a utility function is balancedis_balanced
Print level balance of your designlevel_balance
Attribute level occurrence lookup tableslvl_occurrences
Make random drawsmake_draws
Make Modified Latin Hypercube Drawsmake_mlhs
Make pseudo random drawsmake_pseudo_random
Make scrambled Halton drawsmake_scrambled_halton
Make scrambled sobol drawsmake_scrambled_sobol
Wrapper for halton()make_standard_halton
Make sobol drawsmake_standard_sobol
Find minimum level occurrencesmin_lvl_occurrence
Find the number of levelsnlvls
Evaluating a distributionlognormal lognormal_p normal normal_p triangular triangular_p uniform uniform_p
Extract or set attribute level occurrencesoccurrences
Prepare the list of priorsprepare_priors
Creates a printable version of the efficiency criteriaprint_efficiency_criteria
Prints the initial header for the table of resultsprint_initial_header
Prints iteration informationprint_iteration_information
A generic function for printing an 'spdesign' objectprint.spdesign
Generic for extracting the vector of priorspriors
Calculate the probabilities of the designprobabilities
Calculate the MNL probabilitiesprobabilities_mnl
Compute the radical inverseradical_inverse
Make a random designrandom
Create a random design_object candidaterandom_design_candidate
Relabeling of attribute levelsrelabel
Removes all bracketsremove_all_brackets
Removes the parameter from the utility stringremove_prior
Remove round bracketremove_round_brackets
Remove square bracketremove_square_brackets
Remove all white spacesremove_whitespace
Repeat columnsrep_cols
Repeat rowsrep_rows
Make a design candidate based on the rsc algorithmrsc
Sets the default level occurrence in an attribute level balanced designset_default_level_occurrence
Validate design optset_default_options
Shuffle the order of points in the unit interval.shuffle
Create a summary of the experimental designsummary.spdesign
Swapping of attributeswap
Check if the design is too smalltoo_small
Transform distributiontransform_distribution
Transform to the lognormal distributiontransform_lognormal
Transform to the normal distributiontransform_normal
Transform to the triangular distributiontransform_triangular
Transform to the uniform distributiontransform_uniform
Update the utility functionupdate_utility
Create formulas from the utility functionsutility_formula
Extract the variance co-variance matrixvcov.spdesign