Assignment 1
ECON 3E03 – Fall 2024Due: Sunday, September 29, 11:59pm
Total Marks: 20
Worth: 10% of your final grade
Assignment Description
This assignment provides an introduction to the R software package. This assignment is based onUnits 1 and 2 in the course. Using the course datasets, you will be required to answer a series ofquestions.
Some of the R commands needed to complete the assignment are found throughout the weeklylecture and tutorial notes. You may need to do your own research to find additional codes tocomplete certain questions. The use of AI (e.g., ChatGPT) to assist in coding is permitted;however, please note the following:
- 1) Any code which you obtain from an AI source must be clearly indicated in youranswer documents.
- 2) The AI does not always write accurate codes…
This assignment may be completed individually or in groups of up to four students. o access the assignment submission dropbox, you must join a group on the Avenue Groups
page, even if you are submitting the assignment individually. Students who choose to work in
a group are responsible for forming and managing their own groups. Do not assign yourself to a group with other students unless they have already agreed to work with you.
The assignment is to be submitted via Avenue. Emailed assignments cannot be accepted.The name(s) of the student(s) preparing the assignment must appear clearly onthe title page ofthe assignment. Any “group member” whose name does not appear on the title page will not
receive a grade for the submission. Failure to include a title page will result in a grade deduction.
© Dr. Colin Mang, 2024Assignment Instructions
On Avenue, you will find the following data files listed in the Data Files content folder:spending.RData
LFSJune24.RData
These data files will be used for the assignment.
On Avenue, you will find the following R Script file listed in the Assignments content folder:Assignment R Script.R
Perform the following tasks in order:
- 1) Select you group members to work with.
- 2) All students must enroll in a group on Avenue, even if you are completing the assignment on
your own. If you are working on your own, join an empty group where you will be the onlymember. If you are working with other students then each member of the group must self-enrollin the group on Avenue. 代 写ECON 3E03 R software package. After the first member enrolls, make note of the group number so thatother members can self-enroll in the same group.If you accidently join the wrong group bymistake, please email your professor to correct it. Do not join a group without talking to the other
group members first!
- 3) If you are working on your own, skip this step. If you are working with other students, choosea Group Leader. The Group Leader will be responsible for ensuring the project is submitted andfor other aspects as described below.
- 4) Download the two datasets and the Assignment R Script.R file.
- 5) Rename the Assignment R Script.R file to StudentNumber.R where StudentNumber is the
Group Leader’s student number (i.e., 12345678.R).6) Open the R Script file. The R Script file has the following structure:
#Assignment [Insert Assignment Number] R Script
#[Insert Name(s)]
#ECON3E03 Fall 2024
#Part 1 - spending.RData
set.seed(xx) # Replace xx with group leader student number
SpendingSample <- spending[-sample(1:nrow(spending), 653), ] # Generates a unique
80% sample that is different from any other group
# Use the new datafile SpendingSample for the Part 1 Questions
### Enter Codes for Each Question below this line. If you have used an AI program to
write any codes, you must indicate the use of AI by including " # This code generated by
AI " after the code
### End of Part 1
#Part 2 - LFSJune2024.RData
set.seed(xx) # Replace xx with group leader student number
LFSSample <- LFSJune2024[-sample(1:nrow(LFSJune2024), 4043), ] # Generates aunique 80% sample that is different from any other group
# Use the new datafile LFSSample for the Part 2 Questions
### Enter Codes for Each Question below this line. If you have used an AI program to
write any codes, you must indicate the use of AI by including " # This code generated by
AI " after the code
### End of Part 2
- 7) On Line 1, indicate that this code is for Assignment 1. On Line 2 write the names of all group
members.
- 8) On Lines 7 and 22, replace xx with the group leader’s student number.9) Determine the appropriate code to conduct the tests required for Part 1. Type the code into the
space between the lines:
### Enter Codes for Each Question below this line.
[Enter your codes here]
### End of Part 1
- 10) Determine the appropriate codes to conduct the tests required for Part 2. Type the code into
the space between the lines:
### Enter Codes for Each Question below this line.
[Enter your codes here]
### End of Part 1
- 11) If you have used an AI tool (e.g., ChatGPT) to write any of the codes, you must include the
line:
# This code generated by AI
after each code in your R script that was written by an AI. You must also include the statement in
your answer document for each question where you used an AI.
12) Run your R Script.
- 13) Prepare a written report answering each of the questions below. Copy and paste the analysisoutput from R where appropriate.
- 14) Save your report in MS Word (.docx) or PDF (.pdf) format with the file nameStudentNumber.docx or StudentNumber.pdf where StudentNumber is the student number of thegroup leader. Ensure that the report contains a title page that lists the full names and studentnumbers of all group members and clearly identifies which group member is the group leader forthis assignment. Failure to include a title page will result in a gradededuction.
- 15) Upload the report StudentNumber.docx/StudentNumber.pdf AND the R Script fileStudentNumber.R to the assignment dropbox on Avenue.Note that the set seed and sample commands will take a random 80% subsample of the data that
is different for every group. For this reason, the numbers that you get with your output will notbe the same for any two groups. Be mindful of this fact if you are comparing your work withother groups. If you want to play around with the data to test out commands before running yourR Script, be sure to apply the set seed and sample commands only once before doing so.Assignment Questions The following are the assignment questions. When answering each question, be sure to include
he relevant R output as well as any written explanation required in your answer document.
Part 1 [10 Marks]
Part 1 uses the spending.RData dataset
- 1) [2 Marks] Conduct a hypothesis test of the following: Can we conclude with 95% confidencethat persons who rent their home are less likely than homeowners to have a computer?
- 2) [2 Marks] Conduct a hypothesis test of the following: Can we conclude with 95% confidencethat persons who rent their home are less likely than homeowners to have a vehicle?
- 3) [3 Marks] Create a scatter plot with age on the X-axis and total expenditure on the Y-axis.What is the correlation coefficient between age and total expenditure?
- 4) [3 Marks] Examine the variable SH002. Do persons who own their home and have a mortgagespend more on their principal accommodation than persons who rent?
Part 2 [10 Marks]
Part 2 uses the LFSJune24.RData dataset
- 5) [2 Marks] Create a scatter plot with job tenure on the X-axis and hourly earnings on the Yaxis. What is the correlation between job tenure and hourly earnings?
- 6) [2 Marks] Conduct a hypothesis test of the following: Do persons with a permanent job earnmore per hour than persons who do not have a permanent job?
- 7) [3 Marks] Conduct a hypothesis test of the following: Do persons who are unionized earnmore per hour than persons who are not unionized?
- 8) [3 Marks] Conduct a hypothesis test of the following: Do unionized workers in the public
sector earn more per hour than unionized workers in the private sector?A note on plagiarism: this is an independent assignment, which you are expected to complete within your own group. It is plagiarism to copy someone else’s work verbatim, which includes R Script files. Any work you submit should be the product of your group only.
标签:code,group,package,AI,assignment,ECON,Part,3E03,your From: https://www.cnblogs.com/comp9021/p/18442755