Skip to main content

Posts

Modifying Some Plots in R

Grant Data : 500 Households that get Social Grant in a certain region, the data comes from Social and Economic Survey. Download the dummy data:  DATA grant <- read.csv( "grant.csv" ) #PFOODEXP: Proportion of Food Expenditure to Total Expenditure #HH_Income: Household Income ($) #HH_FOOD: Household Food Expenditure ($) #HH_Loc: Household Location (0: Rural, 1: Urban) #Educ_H: Household Head Education (Year) #HH_Size: Household Family Member #Gender_H: Household Head Gender (0: Female, 1: Male ) #Age_H: Household Head Age #Remove 1st column grant[ 1 ] <- NULL #change variable type to factor grant$Gender_H <- as.factor(grant$Gender_H) grant$HH_Loc <- as.factor(grant$HH_Loc) head(grant) ## PFOODEXP HH_Food HH_Loc Gender_H Age_H Educ_H HH_Size HH_Income ## 1 73.16933 675.1766 1 0 32 22 4 922.7590 ## 2 69.77417 596.2286 1 1 27 22 13 854.5119 ## 3 63.31992 585.4946 0 1 42 15...