From 52081e7670c09ba992194caa3a09a582282451d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jungeh=C3=BClsing?= <jj43vyzo@usr.idiv.de> Date: Thu, 6 Jun 2024 13:56:58 +0200 Subject: [PATCH] Add documentation for the poetest function --- NAMESPACE | 1 + R/poetest.R | 19 ++++++++++++++++++- man/takedraws.Rd | 30 ++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 man/takedraws.Rd diff --git a/NAMESPACE b/NAMESPACE index 6fa724c..ce049c9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,4 +5,5 @@ export(createSets) export(quicktexregapollo) export(remGOF) export(subcoef) +export(takedraws) importFrom(magrittr,"%>%") diff --git a/R/poetest.R b/R/poetest.R index 49723eb..d04c680 100644 --- a/R/poetest.R +++ b/R/poetest.R @@ -1,4 +1,21 @@ - +# This function lets us perform the Poe (2005) test on WTP values + + +#' Perform the Poe (2005) test on different discrete choice models +#' +#' @param n number of draws +#' @param model1 Model from which to take the first WTP values +#' @param model2 Model from which to take the second WTP values +#' @param att Vector of attributes whose WTP values you want to compare +#' @param price nmae of the price coefficient +#' +#' +#' @return a p value associated with "WTP1>WTP2" +#' @export +#' +#' @examples { +#' poeresults<-poetest(n=5000, model1 = clmodels[[model_1]],model2 = clmodels[[model_2]], att=attr, price = "bcost") +#' } ## Extract relevant elements of models diff --git a/man/takedraws.Rd b/man/takedraws.Rd new file mode 100644 index 0000000..3b97639 --- /dev/null +++ b/man/takedraws.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/poetest.R +\name{takedraws} +\alias{takedraws} +\title{Perform the Poe (2005) test on different discrete choice models} +\usage{ +takedraws(n = 10000, beta, vc) +} +\arguments{ +\item{n}{number of draws} + +\item{model1}{Model from which to take the first WTP values} + +\item{model2}{Model from which to take the second WTP values} + +\item{att}{Vector of attributes whose WTP values you want to compare} + +\item{price}{nmae of the price coefficient} +} +\value{ +a p value associated with "WTP1>WTP2" +} +\description{ +Perform the Poe (2005) test on different discrete choice models +} +\examples{ +{ +poeresults<-poetest(n=5000, model1 = clmodels[[model_1]],model2 = clmodels[[model_2]], att=attr, price = "bcost") +} +} -- GitLab