Hi all,
New to Jamovi and wondering if anyone might be able shed light on the following data clean-up challenge I'm facing. In brief I'm working with cost data related to medical care from different points in time. The points in time are broken down by year and quarter (2018 Q1, 2019 Q3, etc.) and I am currently trying to adjust all the cost to Q1 2021 dollars. Is there any way using transformed or computed variables I can establish logic that essentially creates my new corrected cost variable based on the year.
For example: if encounter period == 2018 Q1 then corrected cost == original cost multiplied by X, if encounter period == 2019 Q1 then corrected cost == original cost multiplied by Z, and so forth and so on.
Thanks for any help. Hoping to avoid going back to doing this all in excel.
adjusting costs, from different yrs, for inflation
Re: adjusting costs, from different yrs, for inflation
transformed variables would be ideal for that:
https://blog.jamovi.org/2018/10/23/transforming-variables.html
cheers
jonathon
https://blog.jamovi.org/2018/10/23/transforming-variables.html
cheers
jonathon
Re: adjusting costs, from different yrs, for inflation
Thanks for the quick response Jonathon! Trying my hand at the transform functionality now.
I can get the transform function to work if I only have one recode condition, however if I try to add an additional recode condition such as (if $source == Q1 2018) I keep getting a "the formula is mis-specified" error message. I'm guessing the error is with my if statement since with only one recode condition it works without issue.
Should I be setting up the recode condition differently?
Thanks all for any help!
best,
Xavier
I can get the transform function to work if I only have one recode condition, however if I try to add an additional recode condition such as (if $source == Q1 2018) I keep getting a "the formula is mis-specified" error message. I'm guessing the error is with my if statement since with only one recode condition it works without issue.
Should I be setting up the recode condition differently?
Thanks all for any help!
best,
Xavier
Re: adjusting costs, from different yrs, for inflation
if your variable name has spaces in it, you have to surround it with backticks (backtick key should be at the top left of your keyboard).
i.e.
if $source == `Q1 2018`
jonathon
i.e.
if $source == `Q1 2018`
jonathon
Re: adjusting costs, from different yrs, for inflation
sorry, that's if you're comparing the value in $source against the value in the `Q1 2018` column ... i'm guessing you're wanting to compare the $source against the text value "Q1 2018" in which case you'll want to use quotes
Re: adjusting costs, from different yrs, for inflation
Bingo! Thanks so much for clarifying and again for the super fast response.
Much appreciated!
Much appreciated!