Goal: Compare multiple means/proportions with plots and hypothesis tests.

Use the Labout Force Survey data for Toronto.

  1. Recreate the following plot, showing the density of job tenure in years for employed individuals, “faceted” by education level (educ).
  1. Calculate the average tenure in years, broken down by education levels.Based on your results and the previous plot, does average tenure seem the same across education levels?

  2. Perfmorm a permutation test for the equality of average tenure across different education levels. Do the results confirm your previous answer?

  3. Create a normalised barplot showing the proportion of single people (marstat==6) at different education levels.

  4. Test whether the proportion of singles is equal across education levels. What do you conclude?

  5. Recreate the following mosaic plot of age group (age_12) vs education level.

LS0tDQp0aXRsZTogIlNUQUE1NyAtIFdvcmtTaGVldCAxMyINCmF1dGhvcjogJ05hbWU6ICAgICwgSUQjOiAgICcNCm91dHB1dDogaHRtbF9ub3RlYm9vaw0KZWRpdG9yX29wdGlvbnM6IA0KICBjaHVua19vdXRwdXRfdHlwZTogaW5saW5lDQotLS0NCg0KKioqDQoNCioqR29hbCoqOiBDb21wYXJlIG11bHRpcGxlIG1lYW5zL3Byb3BvcnRpb25zIHdpdGggcGxvdHMgYW5kIGh5cG90aGVzaXMgdGVzdHMuDQoNCg0KVXNlIHRoZSBMYWJvdXQgRm9yY2UgU3VydmV5IGRhdGEgZm9yIFRvcm9udG8uDQpgYGB7ciwgaW5jbHVkZT1GQUxTRX0NCmxpYnJhcnkodGlkeXZlcnNlKQ0KbGZzID0gcmVhZF9jc3YoJy4uL2RhdGEvTEZTX1Rvcm9udG8uY3N2JykgDQpgYGANCg0KMS4gUmVjcmVhdGUgdGhlIGZvbGxvd2luZyBwbG90LCBzaG93aW5nIHRoZSBkZW5zaXR5IG9mIGpvYiB0ZW51cmUgKmluIHllYXJzKiBmb3IgZW1wbG95ZWQgaW5kaXZpZHVhbHMsICoiZmFjZXRlZCIqIGJ5IGVkdWNhdGlvbiBsZXZlbCAoYGVkdWNgKS4gDQoNCiFbXShpbWcvZmFjZXRlZF9kZW5zaXR5LlBORykNCg0KDQoyLiBDYWxjdWxhdGUgdGhlICphdmVyYWdlKiB0ZW51c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