Skip to content

Paasche and Laspeyres indexes calculation provide the same results, if indexMethod is not defined #83

@fabiocs8

Description

@fabiocs8

For each instance in the code below, both Paasche and Laspeyres indexes are the same. Laspeyres is the correct one, and Paasche wrongly replicates Laspeyres values. This is because there was a typo in "indexMmethod", instead of teh correct " indexMethod".

methods <- c("paasche","laspeyres")
ind_pkg_chained <- lapply(methods, function(x) {priceIndex(CES_sigma_2,
pvar = "prices",
qvar = "quantities",
pervar = "time",
prodID = "prodID",
indexMmethod = x,
output = "chained"
)}) |> as.data.frame(col.names = methods)

So it would be advisible that if "indexMethod" is not defined (for instance, in this case it was a mispelling) that priceIndex function stop and ask for one of the existing methods.

Thank you.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions