ค่าเช่าแพงเกินไปไหม?

การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

Lee Hachadoorian

Asst. Professor of Instruction, Temple University

คำนิยาม

วิธีคำนวณค่าเช่า:

  • Contract Rent: ค่าเช่าตามสัญญาเช่า
  • Gross Rent: ค่าเช่ารวมค่าสาธารณูปโภค ซึ่งบางสัญญารวมไว้แล้ว บางสัญญาผู้เช่าจ่ายแยกต่างหาก

ภาระค่าเช่า:

  • Rent Burden: จ่ายค่าเช่า 30% ขึ้นไปของรายได้ครัวเรือน
  • Severe Rent Burden: จ่ายค่าเช่า 50% ขึ้นไปของรายได้ครัวเรือน
การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

Table B25074: HH Income By Gross Rent As a Percentage of HH Income in the Past 12 Months

Total
    Less than $10,000
        Less than 20.0 percent
        20.0 to 24.9 percent
        25.0 to 29.9 percent
        30.0 to 34.9 percent
        35.0 to 39.9 percent
        40.0 to 49.9 percent
        50.0 percent or more
        Not computed
    $10,000 to $19,999
    $20,000 to $34,999
    $35,000 to $49,999
    $50,000 to $74,999
    $75,000 to $99,999
    $100,000 or more
การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

สัดส่วนค่าเช่าต่อรายได้ในสหรัฐอเมริกา, ACS 2012-2016

total                                     42835169
inc_under_10k                              5558843
inc_under_10k_rent_under_20_pct              57052
inc_under_10k_rent_20_to_25_pct              58042
inc_under_10k_rent_25_to_30_pct             208806
inc_under_10k_rent_30_to_35_pct             177709
inc_under_10k_rent_35_to_40_pct             102565
inc_under_10k_rent_40_to_50_pct             150153
inc_under_10k_rent_over_50_pct             3381537
inc_under_10k_rent_not_computed            1422979
inc_10k_to_20k                             7027373
inc_10k_to_20k_rent_under_20_pct            213000
etc...
การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

การคำนวณภาระค่าเช่า

print(rent.columns[10:19])
Index(['inc_10k_to_20k', 'inc_10k_to_20k_rent_under_20_pct',
   'inc_10k_to_20k_rent_20_to_25_pct', 'inc_10k_to_20k_rent_25_to_30_pct',
   'inc_10k_to_20k_rent_30_to_35_pct', 'inc_10k_to_20k_rent_35_to_40_pct',
   'inc_10k_to_20k_rent_40_to_50_pct', 'inc_10k_to_20k_rent_over_50_pct',
   'inc_10k_to_20k_rent_not_computed'],
  dtype='object')
การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

การคำนวณภาระค่าเช่า

rent["inc_10k_to_20k_rent_burden"] = 100 * (

rent["inc_10k_to_20k_rent_30_to_35_pct"] + rent["inc_10k_to_20k_rent_35_to_40_pct"] + rent["inc_10k_to_20k_rent_40_to_50_pct"] + rent["inc_10k_to_20k_rent_over_50_pct"]
) / ( rent["inc_10k_to_20k"] - rent["inc_10k_to_20k_rent_not_computed"] )
การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

การคำนวณภาระค่าเช่า

print(rent["inc_10k_to_20k_rent_burden"])
0    87.008024
Name: inc_10k_to_20k_rent_burden, dtype: float64
การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

การคำนวณภาระค่าเช่าด้วยลูป

# Create list with income category part of column names
incomes = ["inc_under_10k", "inc_10k_to_20k", "inc_20k_to_35k", 
           "inc_35k_to_50k", "inc_50k_to_75k", "inc_75k_to_100k", 
           "inc_over_100k"]
การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

การคำนวณภาระค่าเช่าด้วยลูป

# Create new DataFrame with just the geography name
rent_burden = rent["name"]

# Loop over the list of income categories
for income in incomes:

# Construct column names rent_burden[income] =
100 * (rent[income + "_rent_30_to_35_pct"] + rent[income + "_rent_35_to_40_pct"] + rent[income + "_rent_40_to_50_pct"] + rent[income + "_rent_over_50_pct"]) / ( rent[income] - rent[income + "_rent_not_computed"])
การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

ภาระค่าเช่าในสหรัฐอเมริกา จำแนกตามกลุ่มรายได้

print(rent_burden.squeeze())
name               United States
inc_under_10k            92.1685
inc_10k_to_20k            87.008
inc_20k_to_35k           74.7448
inc_35k_to_50k           43.0434
inc_50k_to_75k           21.0937
inc_75k_to_100k          9.11853
inc_over_100k            3.14882
Name: 0, dtype: object

กราฟแท่งแสดงเปอร์เซ็นต์ครัวเรือนที่มีภาระค่าเช่าใน 7 กลุ่มรายได้ เมื่อรายได้เพิ่มขึ้น แท่งกราฟลดลงจาก 92% เหลือ 3% ของครัวเรือน

การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

มาฝึกกันเถอะ!

การวิเคราะห์ข้อมูลสำมะโนประชากรสหรัฐฯ ด้วย Python

Preparing Video For Download...