i have a data that contains age and year(1991-2008)
i filtered my data that age gets 1 if<19 and 0 if > 19
database$age_cat[database$under19==1] <- "below 19 "
database$age_cat[database$under19==0] <- "above 19 "
percentage <- aggregate(insured~age_cat+year,data = database,mean)
z <- ggplot(data = percentage, mapping =aes(x=year,y=insured,color=age_cat)) + geom_point()
z+ scale_color_manual(values=c("blue", "red"))
i want to show the change of the percentage of insured age groups <19 and >=19 over years and to show each dot in every year in a different colour. (to explain my self i need to show each percentage of each dot in every year ) i tried using ggplot but its showing the mean and not percentage any suggestions?