-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions about calculating livelihoods status scores #27
Comments
Hi @MijuKim, thanks for the question. I think you're understanding R really well! I've looked at the code you pasted above and I understand your question. This is what you pasted in the excel file: region_id year jobs_sum wages_avg jobs_sum_first wages_avg_first x_jobs x_wages score
<int> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 0 2010 620374.2 43625136 620374.2 43625136 1.0000000 1.0000000 98.38118
2 0 2011 585561.9 44633911 620374.2 43625136 0.9438849 1.0000000 98.38118
3 0 2012 593994.1 45458780 620374.2 43625136 0.9574771 1.0000000 98.38118
4 0 2013 611679.0 44843201 620374.2 43625136 0.9859839 1.0000000 98.38118
5 0 2014 613159.0 41984945 620374.2 43625136 0.9883697 0.9624026 98.38118 It is not averaging over the past 5 years but it is comparing the most recent year (2014) to the reference year, which is 5 years ago (2010). All years of the Let me know if you have other questions! |
score = (x_jobs + x_wages) / 2 * 100) |
Julie and I already talked about this.
|
Hi,
I'm working on 'functions.R' to calculate livelihoods status scores. What I found and understood is that it averages jobs and wages scores for last 5 years (e.g. 2010 - 2014) not for the latest one year (e.g. 2014).
I just copied that part of the code:
mutate( x_jobs = pmax(-1, pmin(1, jobs_sum / jobs_sum_first)), x_wages = pmax(-1, pmin(1, wages_avg / wages_avg_first)), score = mean(c(x_jobs, x_wages), na.rm=T) * 100)
I attached a middle result of status score.
liv_status_score.xlsx
I'd like to know whether this (5-year-average) is right, or it is corrected later on functions.r. I'm not an expert on R so that there is high probability that I missunderstood.
It would be great if anyone can help on this.
Thanks,
Miju
The text was updated successfully, but these errors were encountered: