Question: 1 . Load the R data LifeCycleSavings, from the datasets package, in your R session. Marks ( 1 ) 2 . Use the values of

1. Load the R data LifeCycleSavings, from the datasets package, in your R session.
Marks (1)
2. Use the values of the variable pop15 and ddpi to create two new categorical variables named Pop15Cat and ddpiCat, respectively, each with three categories, High(top 25%),Medium( middle 50%) and low(bottom 25%). Show your codes.
1. Hint: To do this, you must find a function to obtain the required cut-off points and then another function to implement the binning of the variables. Marks (4)
3. Count (frequency of) cases within each new categorical variable. Show codes and output. Marks (2)
4. Use a visualization tool to display the relationship between the variables,
sr and Pop15Cat, stratified by ddpiCat, on a single plot.
Comment on the plot do you observe any relationship between the three variables?
You must use ggplot2 for visualization. Wherever applicable, your plots must have proper labelling and legends. Marks (5)
please provide me code and explaination.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!