0% found this document useful (0 votes)
75 views7 pages

SOC 210 Lab Assignment #2

The document analyzes data from a labour force survey. It performs statistical tests to examine the relationship between job permanency and earnings, earnings across regions, and the relationship between hours worked and earnings. The tests show permanent workers earn more than temporary workers, earnings vary by region, and hours worked is positively correlated with higher earnings.

Uploaded by

sfomutere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views7 pages

SOC 210 Lab Assignment #2

The document analyzes data from a labour force survey. It performs statistical tests to examine the relationship between job permanency and earnings, earnings across regions, and the relationship between hours worked and earnings. The tests show permanent workers earn more than temporary workers, earnings vary by region, and hours worked is positively correlated with higher earnings.

Uploaded by

sfomutere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

SOC 210 Lab Assignment #2

Question 1.

Question 2.
a)

b)
Question 3)
Box plot

Independent samples t-test


The findings from the independent sample t-test indicates that there statistically significant
difference in mean of hourly earnings between the permanent and temporary workers
(t(6338.5) =36.525, P <0.05). This confirms that permanent workers (Mean of group
=29.31579) earn more than temporary workers (Mean of group =21.74403) due to the
varying work conditions of their jobs.

Question 4.
Boxplot

ANOVA Results
An ANOVA test was performed to determine whether hourly earnings vary by
province/region. The results shows that there is statistically significant differences in hourly
earnings by province/region F (4, 24081) = 74.32, P <0.05). This confirms that the hourly
earnings vary by province/region.

Question 5
Scatterplot

Regression analysis
A regression analysis was performed to examine whether there is a significant relationship
between hours of work per week and hourly earnings across workers. The results show that
there is a statistically significant relationship between hours of work per week and hourly
earnings across workers (F(1, 24084) =723.9, P <0.05).
The regression model given the coefficient values is
HRLYEARN =0.231431UTOTHRS +19.619471
Therefore, from
y=bx+ α
The slope (b) from the equation is 0.231431 while the e intercept ¿) is 19.619471. The r2
value from the regression output = 0.02918. Therefore, the r value = sqrt (0.02918) =
0.1708215

setwd("C:/Users/HP/Desktop")
getwd()
install.packages("readxl")
install.packages("dplyr")
install.packages("ggplot2")
library(readxl)
library(dplyr)
library(ggplot2)
data <- read_excel("July_2017_21_Labour_Force_Survey_dataset.xlsx")
# Open a data viewer in RStudio
View(data)
data <- data %>%
mutate(PERMTEMP2 = ifelse(PERMTEMP == 1, "Permanent", "Temporary"))
# Recode PROV into PROV2
data <- data %>%
mutate(PROV2 = case_when(
PROV %in% c(10, 11, 12, 13) ~ "Atlantic",
PROV == 24 ~ "Quebec",
PROV == 35 ~ "Ontario",
PROV %in% c(46, 47, 48) ~ "Prairies",
PROV == 59 ~ "British Columbia",
TRUE ~ as.character(PROV) # Keep other values as is
))
# Create a boxplot
ggplot(data, aes(x = PERMTEMP2, y = HRLYEARN)) +
geom_boxplot() +
labs(title = "Relationship between Job Permanency and Hourly Earnings",
x = "Job Permanency",
y = "Hourly Earnings")
# Hypothesis testing
t_test_result <- t.test(HRLYEARN ~ PERMTEMP2, data = data)
t_test_result
# Create a boxplot
ggplot(data, aes(x = PROV2, y = HRLYEARN)) +
geom_boxplot() +
labs(title = "Hourly Earnings Across Regions",
x = "Region",
y = "Hourly Earnings")

# ANOVA test
anova_result <- aov(HRLYEARN ~ PROV2, data = data)

# Display ANOVA results


summary(anova_result)
# Create a scatterplot
ggplot(data, aes(x = UTOTHRS, y = HRLYEARN)) +
geom_point() +
labs(title = "Relationship between Hours Worked per Week and Hourly Earnings",
x = "Hours Worked per Week",
y = "Hourly Earnings")
# Bivariate regression analysis
regression_model <- lm(HRLYEARN ~ UTOTHRS, data = data)

# Display regression results


summary(regression_model)
# Calculating r from R -squared value
result <- sqrt(0.02918)
print(result)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy