CS201 MID TERM SOLVED MCQs || PAST PAPERS || GROUP-1 || INTRODUCTION TO PROGRAMMING || VuTech Visit Website For More Solutions www.vutechofficial.blogspot.com …
STA632 ASSIGNMENT NO. 1 SPRING 2023 || 100% RIGHT SOLUTION || SAMPLING TECHNIQUES || BY VuTech
Visit Website For More Solutions www.vutechofficial.blogspot.com
KINDLY, DON’T COPY PASTE
QUESTION-1
a)Write the R-commands for generating 800 random variables from normal distribution by using the following information. Mean = 10, Standard deviation = 4, n=5 and k=2500.
Solution:
To generate 800 random variables from a normal distribution with a mean of 10, standard deviation of 4, n of 5, and k of 2500, you can use the following R commands:
set.seed(123) # Set a seed for reproducibility (optional)
# Generate random variables
random_vars <- rnorm(n = 800, mean = 10, sd = 4)
# Reshape the vector into a matrix of dimensions (n x k)
In the above code, rnorm() is used to generate 800 random variables from a normal distribution with the specified mean (10) and standard deviation (4). The set.seed() function is optional but allows you to reproduce the same set of random numbers.
The matrix() function reshapes the vector of random variables into a matrix with dimensions (n x k), where n is the number of rows (5) and k is the number of columns (160).
Finally, rowMeans() and colMeans() are used to calculate the row means and column means, respectively, of the generated matrix.
b) Simulate a coin toss for 30 times using R-commands." solve it in detail.
SOLUTION:
To simulate a coin toss for 30 times using R commands, you can use the following code:
set.seed(456) # Set a seed for reproducibility (optional)
In the above code, sample() is used to randomly select between "Heads" and "Tails" for 30 times (size = 30) with replacement (replace = TRUE). The set.seed() function is optional but allows you to reproduce the same sequence of coin tosses.
Finally, the print() function is used to display the simulated coin toss results.
QUESTION-2
a)Find the sample size for three strata by proportional allocation from the following information.
Stratum
`N_h`
`N_h^2`
A
4397
30759.85
B
751
319594.07
C
1009
277243.00
The required sample size is 250.
Solution:
To find the sample size for three strata by proportional allocation, you need to allocate the sample size proportionally based on the size of each stratum. Here's how you can calculate the sample sizes for each stratum:
Calculate the total population size across all strata:
Total population = Population size in Stratum A + Population size in Stratum B + Population size in Stratum C
Calculate the proportion of each stratum:
Proportion of Stratum A = Population size in Stratum A / Total population
Proportion of Stratum B = Population size in Stratum B / Total population
Proportion of Stratum C = Population size in Stratum C / Total population
Calculate the sample size for each stratum:
Sample size for Stratum A = Proportion of Stratum A * Required sample size
Sample size for Stratum B = Proportion of Stratum B * Required sample size
Sample size for Stratum C = Proportion of Stratum C * Required sample size
Using the provided information:
Total population = 4397 + 751 + 1009 = 6157
Proportion of Stratum A = 4397 / 6157 ≈ 0.7134
Proportion of Stratum B = 751 / 6157 ≈ 0.1219
Proportion of Stratum C = 1009 / 6157 ≈ 0.1647
Sample size for Stratum A = 0.7134 * 250 ≈ 178.35
Sample size for Stratum B = 0.1219 * 250 ≈ 30.475
Sample size for Stratum C = 0.1647 * 250 ≈ 41.175
Therefore, the sample sizes for the three strata, rounded to whole numbers, would be approximately:
Stratum A: 178
Stratum B: 30
Stratum C: 41
b) At the end of every school year, the school administers a reading test to a sample of 36 third graders. The school system has 20,00 third graders, half boys and half girls. The results from last year's test are shown in the table below.
Stratum
Mean score
Standard deviation
Boys
60
10.27
Girls
55
6.66
This year, the researchers plan to use a stratified sample, with one stratum consisting of boys and the other, girls. Use the results from last year to answer the following questions? To maximize precision, how many sampled students should be boys and how many should be girls?
Solution:
To maximize precision in the stratified sample, you should allocate the sample size based on the variances of the two strata. In this case, the strata are boys and girls. Here's how you can calculate the sample sizes for boys and girls:
Calculate the variance of each stratum:
Variance of boys = Standard deviation of boys squared = 10.27^2
Variance of girls = Standard deviation of girls squared = 6.66^2
Calculate the proportion of boys and girls in the population:
Proportion of boys = Proportion of girls = 1/2 (since half are boys and half are girls)
Calculate the allocation fraction for each stratum:
Allocation fraction for boys = Variance of boys / (Variance of boys + Variance of girls)
Allocation fraction for girls = Variance of girls / (Variance of boys + Variance of girls)
Calculate the sample sizes for boys and girls:
Sample size for boys = Allocation fraction for boys * Total sample size
Sample size for girls = Allocation fraction for girls * Total sample size
Using the provided information:
Variance of boys = 10.27^2 ≈ 105.4249
Variance of girls = 6.66^2 ≈ 44.3556
Proportion of boys = Proportion of girls = 1/2
Allocation fraction for boys = 105.4249 / (105.4249 + 44.3556) ≈ 0.7037
To maximize precision, you should round the sample sizes to the nearest whole numbers:
Sample size for boys: 25
Sample size for girls: 11
Therefore, to maximize precision, you should sample 25 boys and 11 girls.
KINDLY, DON’T COPY PASTE SUBSCRIBE, SHARE, LIKE AND COMMENTS FOR MORE UPDATES SEND WHATSAPP OR E-MAIL FOR ANY QUERY 0325-6644800 kamranhameedvu@gmail.com Visit Website For More Solutions www.vutechofficial.blogspot.com
We provide Virtual University of Pakistan Study Materials such as Solution of Assignments, GDBs, Mid Term Solved Papers, Final Term Solved Papers, Mid Term Solved MCQs, and Final Term Solved MCQs. We also provide regular Semester Quizzes, Updated Handouts, and Short Questions and Answers. We help you with your research and many other educational-related topics, as far as we know. Furthermore, Share your problem with us and Please feel free to ask any related questions.