DS4PS / cpp-528-fall-2020

Course shell for CPP 528 Foundations of Data Science III - Project Management
http://ds4ps.org/cpp-528-fall-2020/
1 stars 1 forks source link

Variable for Lab4 and Lab5 #40

Closed jrcook15 closed 3 years ago

jrcook15 commented 3 years ago

Hi Professor,

Hope you had a great holiday and weekend. Just wanted to confirm some code on Lab 4 that is also on Lab 5. There is one variable that I am curious if it should be the clean inflated value, or the original value, it is mhmval00 the original dollar amount for the home without inflation. The rest of the variables in this filtered dataset are transformed to reflect the change in home value with inflation. Should this one also be with inflation?

pct_mhmval_change = mhmval_change / mhmval00

now keep a subset of relevant records ----

filtered_ltdb_2000_2010_df <- ltdb_2000_2010_df %>%

only keep urban tracts

dplyr::filter(urban == "urban") %>%

create new columns

dplyr::mutate(

adjust 2000 home values for inflation

clean_mhmval00 = mhmval00 * INFLATION_RATE,
# calculate the raw difference between 2010 & 2000 med. home value 
mhmval_change = mhmval10 - clean_mhmval00,
# calculate the % difference
pct_mhmval_change = mhmval_change / mhmval00
) %>%

keep records where home values are greater than lower bound

note: this is because these are outliers

than can be examined at a later date

dplyr::filter(clean_mhmval00 > LOWER_BOUND_MHMVAL

keep records where the % change in home values are

            # less than the upper bound
            & pct_mhmval_change < UPPER_BOUND_PCT_MHMVAL_CHANGE)
cenuno commented 3 years ago

Hi @jrcook15 -- you are correct, thank you for finding this error. The % change variable should have used the clean_mhmval00 variable as the denominator.

jrcook15 commented 3 years ago

Awesome. Thank you for the clarification.

On Mon, Nov 30, 2020 at 11:09 AM Cristian E. Nuno notifications@github.com wrote:

Hi @jrcook15 https://github.com/jrcook15 -- you are correct, thank you for finding this error. The % change variable should have used the clean_mhmval00 variable as the denominator.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DS4PS/cpp-528-fall-2020/issues/40#issuecomment-735940676, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM7P6WNG2RMKNGBTUOFA6P3SSPLNJANCNFSM4UGAHMCA .

-- -J