logo

The mean of the 5 systematic samples

   

Added on  2022-08-29

5 Pages1063 Words23 Views
Sampling Techniques
Here the dataset contains scores of 312 students in two tests. At, first, the dataset is loaded.
mydata=read.csv("D:/StudentsMarks.csv")
View(mydata)
Since the study is based on test 1 scores, a new dataset is formed by taking only test 1 scores and omitting
the missing values and test 2 scores.
x=na.omit(mydata$Test.1)
N=length(x)
N
## [1] 312
Part a
A histogram is created to visualize the distribution of test 1 scores.
hist(x , breaks = 20, col = 'skyblue3' , ylab = 'Frequency', xlab='Marks')Histogram of x
Marks
Frequency
40 60 80 100
0 10 20 30 40
1

From the histogram, it can be observed that the distribution of test 1 marks is skewed to the left.
mean_x <- sum(x)/N
mean_x
## [1] 70.79167
var_x <- sum((x-mean_x)^2)/N
std_x <- sqrt(var_x)
std_x
## [1] 15.49539
The mean and the standard deviation are found to be 70.79167 and 15.49539. Hence, it can be deduced that
on average student gets 70.79167=71(approx.)in test 1.
Part b
Here a systematic Sample of size 20 is drwan from the population.
# draw a systematic sample
# there are 312 observations
# sample of 20 is required
k <- 312/20
k
## [1] 15.6
set.seed(1)
s <- sample(1:15,1);s
## [1] 9
sam_index <- c()
for (i in 1:20){
sam_index <- c(sam_index, 9 + i*9 )
}
sam_index
## [1] 18 27 36 45 54 63 72 81 90 99 108 117 126 135 144 153 162 171 180
## [20] 189
# taking sample
mydata_sys <- mydata[sam_index,]
Now treating the sample as SRS, mean and standard deviation are calculated.
# treat the sample as SRS
x_srs <- mydata_sys$Test.1
# obtain the mean
mean_x_srs <- sum(x_srs)/length(x_srs);mean_x_srs
## [1] 65.8
2

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
R Programming Modules And Program
|12
|1142
|43

Repeated Systematic Sample
|5
|443
|24

Question 1 Frequency distribution.
|5
|481
|99

Mathematics Assignment - Sample Mean, Standard Deviation, Confidence Interval
|9
|761
|61

Statistical Investigation Assignment
|10
|1353
|275

Business Statistics: Hypothesis Testing
|9
|1209
|285