Problem Set 1 - Introduction to Statistics and Programming
Due date: February 17, 2025
Instructions
• This problem set is to be submitted individually. However, you are permitted to work in groups but if
two answers are identical may lead to issue of plagiarism.
• There are six sections to this problem set. The first five sections test your understanding of the basic
concepts discussed in class so far. The sixth section is empirical in nature and requires you to work
with R.
• All the answers to this problem set must be presented in a pdf document along with the R Script. For
the questions requiring answers in a paper-pen mode, you can take pictures of your work and append
it to the pdf document.
• The format for pdf document is single-spacing, 12pt Times New Roman font with 1-inch margins on
all sides.
• The deadline for submission is February 17, 2024 11:59 PM. All submissions must be made on
Moodle. Your final submission for both the pdf document and R script should be named
“lastname.firstname_ps1.pdf”. [Link]
Section I - Population and Sampling (2 x 3 = 6 points)
Identify the Population and Sample in the following cases.
a) A university administration wants to assess the satisfaction level of students
regarding the online learning platform. They randomly select 150 students from
different departments and conduct an online survey.
b) A national research institute is studying the effects of social media usage on
teenagers’ mental health. They collect data from 10,000 students aged 13-18,
randomly selected from 200 schools across different regions in the country.
c) A government agency is investigating household water consumption patterns in
urban areas to develop conservation policies. They use census data to randomly
select 3,000 households from 10 major metropolitan cities and analyze their water
bills over the past five years.
Section II - Observational vs Experimental Data (1+1+1+1 =4 points)
Identify if a particular case is observational or experimental with appropriate reason.
a) A nutritionist wants to study the relationship between daily fruit consumption and
heart health. They collect dietary and health data from a group of people over five
years without controlling their diets. Is this an observational or experimental study?
Explain your reasoning.
b) A psychologist is researching the effect of sleep deprivation on memory retention.
Participants are randomly assigned to either a full-night sleep group or a
sleep-deprived group before taking a memory test. Would this be an observational
or experimental study? Provide a reason.
c) A wildlife biologist wants to understand how different species interact in a
rainforest. They spend months observing and recording animal behaviors without
interfering. How would this study be classified, and why?
d) Scientists are testing the effectiveness of a new fertilizer on plant growth. They
divide identical plants into two groups, applying the new fertilizer to one group
while leaving the other untreated. They measure the growth of both groups over
time. Would this be classified as an observational or experimental study? Why?
Section III - Sampling Techniques (2x5 = 10 points)
(i) For each of the following situations, justify whether the selected sampling technique is
appropriate or not.
a) An instructor is interested in knowing if the students can self-learn R from online
resources before teaching it in the class. The instructor selects the first 15 students
alphabetically from the class of 30, and emails them the link to online resources 15
days before the course commences.
b) Recently, a study in India found that married women without kids earn twice as
much as married women with kids. The data used in the study comes from a survey
of 5000 randomly selected employed women in the country.
(ii) For each of the following situations, describe how you would select a sample for the research
question of interest. State the type of sampling technique used.
a) A university wants to assess student satisfaction with its online learning platform. It plans
to survey 200 students out of a total enrollment of 4,000. The student population is
divided into undergraduate (80%), and postgraduate (20%) students across different
programs and majors. How should the university select the sample to ensure all groups
are represented?
b) A large corporation wants to assess employee morale across its 10 departments. Each
department has a different number of employees, ranging from 50 to 500. The company
plans to survey 100 employees. How should the sample be selected to ensure fair
representation?
c) A researcher is studying the work habits of freelancers in a city. Freelancers are not
centrally registered, making it difficult to create a sampling frame. How can the
researcher gather a sample of 30 freelancers for the study?
Section IV Correlation (1+1+1+1+1 = 5 points)
For each of the following situations interpret the correlation, including the strength,
direction, and an explanation of the effect.
a. A study examined the relationship between daily screen time (in hours) and sleep
duration (in hours) among teenagers. The correlation coefficient was found to be
-0.75.
b. A study was carried out on the quantity of potatoes sold and price of potatoes in
Sarjapur area of Bengaluru. Analysis showed the correlation coefficient between the
two variables to be +0.60.
c. A recent study analyzed the relationship between the number of meals per day and
CGPA. Results showed the correlation coefficient between the two variables to be
+0.04.
d. A researcher investigated whether hours of study per day were related to exam
scores among college students. The correlation coefficient was found to be +0.30.
e. A team of scientists studied the relationship between monthly rainfall and crop yield
for a particular type of grain. The correlation coefficient was +0.65.
Section V Numerical Problems (10 points)
The following questions must be done in a pen-and-paper mode. Full points will only be
awarded for clearly showing all the steps involved.
a) The ages of 12 participants in a community workshop are as follows:
22, 25, 30, 28, 25, 28, 27, 29, 32, 24, 33, 21
(i) Find the sample median (1 point). (ii) Find the sample mean. (1 point)
b) A course is taught in two sections (A & B). The details about the scores (out of 10) of
students in these sections are given as below:
Section A Section B
Mean Scores 7 8
Number of Students 20 30
What is the mean score of students when both sections are combined? (2 points)
c) The following data represent the number of attempts it took a student to clear the
UPSC exam:
2, 3, 3, 3, 4, 1, 5.
(i) Find the sample mode of the number of attempts. (1 point)
(ii) Find the sample variance of the number of attempts. (2 points)
(iii) Find the sample standard deviation of the number of attempts (1 point)
d) Subham Jaiswal, a cricketer, has scored the following runs in his last 20 innings:
45, 12, 78, 23, 56, 89, 34, 67, 90, 10, 41, 55, 72, 18, 29, 63, 47, 81, 5, 38
(i) Find the sample median for this dataset (1 point)
(ii) Find the sample 90th percentile of this dataset (1 point)
Section VI Data Analysis in R (15 points)
Data Types and Data Structure (3 points)
1. Use the "[Link]" to answer the following questions. Description of all the
variables in the dataset is given in Table.
a. How many households are given in the table?
b. List the data type for each of the columns in the table.
c. It was found out later that there was a mistake in monthly income calculation and the
monthly income should be INR 1000 more for each household. Add a column called
correct_monthlyincome in R and specify the correct value by adding INR 1000.
Visualization in R (4 points)
2. Using [Link] data
a. Generate a bar graph depicting the distribution of vulnerable and non-vulnerable
households in the sample data considering the global poverty line. Label x and y axes
and title properly.
b. Generate a bar graph depicting the distribution of vulnerable and non-vulnerable
households considering domestic poverty line by caste in the sample data. Clearly label
the x and y axes and give an appropriate title to your graph.
3. Using [Link] data
c. Generate a histogram displaying the distribution of prices of houses. Make sure to label
x and y axes appropriately. Also provide a meaningful title to the plot.
d. Generate a scatter plot between a price and area of house. Interpret the result. Make
sure to label x and y axes appropriately. Also provide a meaningful title to the plot.
Tabulation (4 points)
4. Consider the agricultural household data in the "[Link]". Answer the
following questions:
a. How many households are vulnerable to poverty based on the global poverty line?
b. Find the number of vulnerable and non-vulnerable households under the domestic
poverty line?
c. Find the proportion of vulnerable and non-vulnerable households under the domestic
and global poverty line. Is there a difference? What could be the reason behind the
difference?
d. Find the proportion of upper caste households that are vulnerable to poverty under the
domestic poverty line.
Functions (4 points)
Using [Link] data, answer following questions:
a) What is the average and median area of houses?
b) What is the variance of area and price of houses?
c) Find the sample 1st , 10th , 50th, and 90th percentile of area of houses. How does 50th
percentile relate to median area of houses?
d) How are area and price of houses related?
Table 1: vdsahousehold dataset
Variables Description
Survey Year Year of the survey
Household ID Unique ID of the household in the survey
States State in which the household is located
Household_Income Annual Income of the household in INR
Household_Farm_Area Total Plot area owned by household in
Hectares
Gender_HouseholdHead Gender of the household head
Vulnerability_Domestic Whether the household is vulnerable to
poverty or not based on the domestic
poverty line
Vulnerability_Global Whether the household is vulnerable to
poverty or not based on the global poverty
line
Caste Caste of the household (either lower caste
or upper caste)
Table 2. Banglorehousing dataset
Variable Description
Price Price of House in INR
Area Area of house in [Link]
Location Locality of house
No_of_bedroom Number of bedrooms in houses