usper should slp the five tickets go to women nc of our 3.14 Another sampling ex
ID: 3069471 • Letter: U
Question
usper should slp the five tickets go to women nc of our 3.14 Another sampling experimen ur Let us illustrate sampling variabili ion in a small sample from a small po Is lation. Seven of the 20 college sof. ur ball players listed here are in-state ld students. Their names are mar es with asterisks in the list. The coa s. chooses five players at random to re- . ceive a new scholarship funded by alumni. Betsa Richvalsky* Romero Sbonek Susalla Swearingen Sweet Swift Vargas Wagner Wald* h Blanco s Christner e Connell Driesenga* Falk Garfinkel* Lawrence Montemarano RamirezExplanation / Answer
a) R-code :
Note that: 1) in-state students are written as "in- " in starting.
2) to fix the sample use "set.seed()" command and in bracket write any no of your choice.
X=c("Betsa", "Blanco","christner","connell","in_Driesenga","Falk","in_Garfinkel","Lawrence","Montemarano","Ramirez","in_Richvalsky","Romaro","in_Sbonek","in_susalla","Swearingen","sweet","in_swift","Vargas","Wagner","in_Wald")
length(X)
SRS=matrix(nrow=20,ncol=5,byrow=TRUE)## Rows represent the sample.
for(i in 1:20)
{
SRS[i,]=sample(X,size=5,replace=FALSE)
}
SRS
instate_stud=c()
for(i in 1:20)
{
A=unlist(strsplit(SRS[i,],"_"))
instate_stud[i]=length(which(A=="in"))
}
instate_stud ## No. of in-state student in each sample.
hist(instate_stud)
mean(instate_stud) ## Average no of in-state students.
From the above code I got the following results:
firt five sample are listed here:
[,1] [,2] [,3] [,4] [,5]
[1,] "Blanco" "sweet" "in_swift" "in_Driesenga" "christner"
[2,] "Betsa" "connell" "Romaro" "in_Wald" "in_swift"
[3,] "Lawrence" "sweet" "in_Garfinkel" "Vargas" "in_Driesenga"
[4,] "Montemarano" "in_Wald" "Ramirez" "Romaro" "Blanco"
[5,] "in_Driesenga" "Swearingen" "Blanco" "in_Sbonek" "connell"
instate_stud gives the no of in-state students in each sample.
> instate_stud ## No. of in-state student in each sample.
[1] 2 2 2 1 2 1 4 3 2 1 2 3 1 3 4 3 3 1 2 2
> mean(instate_stud) ## Average no of in-state students.
[1] 2.2
On an average there are 2 in-state players.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.