get_hpsi_data: Get home purchase sentiment index data

Description Usage Arguments Details Value See Also Examples

View source: R/get_hpsi_data.R

Description

Get home purchase sentiment index data

Usage

1
get_hpsi_data(age_group = NA)

Arguments

age_group

a number between 1 and 4 which may be passed into the function as a character. By default, age_group is NULL, which specifies all ages aggregated into one group. Specifying an age group of 1 refers to the 18-34 years old, 2 refers to 35-44, 3 refers to 45-64, and 4 refers to 65 years old and older.

Details

The home purchase sentiment index (HPSI) is an index calculated using Fannie Mae's National Housing Survey data to represent consumer's home purchase sentiment. Details can be found here.

Value

A tbl_df with the columns date, age_group, and hpsi_value.

See Also

get_nhs_data

Examples

1
2
3
4
5
6
7
8
## This gets HPSI data for all ages aggregated
hpsi_all_ages <- get_hpsi_data()

## getting HPSI data for respondents aged 18-34 years old
hpsi_18_34 <- get_hpsi_data(age_group = 1)

## query the API 4 times to get data for all age groups unaggregated
hpsi_all_unagg <- purrr::map_dfr(1:4, get_hpsi_data)

saadaslam/fannieapi documentation built on May 16, 2019, 9:11 p.m.