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.