Assessment 00
Complete and submit this assessment within two hours of first accessing it. You may paste
your answers directly into this Word file, or submit them as a separate document. 1. What is your name?
2. What is your student number?
3. What version number of Spyder (Python) are you running? Look in the upper, left-hand corner of the Spyder window to find out. If you are not running version 3, please re- download Anaconda 3 and invoke Spyder.
4. Create a variable idnum with your student number as its value. You will use this value to answer the questions below. Execute the command print(idnum). Is it correct?
5. What is printed if you enter import numpy as np; from numpy.random import *; seed(11112111); print(%.3f % rand()) into Spyder?
6. What is printed when you execute the commands seed(idnum); print(%.4f % rand())?
7. Generate uniform random numbers between zero and one using the assignment seed(idnum); w = np.random.rand(200). What is the minimum value among the random numbers?
8. What is the average of the smallest 4 values from the numbers in the w array?
9. What is the sum of the smallest 100 of these numbers in w?
10. What is the median of all the numbers in w that are less than 0.43333?
11. What is the value of y after you enter y = [3,10,12,21]; y = y * 2 into Spyder? Highlight the correct answer, or delete all incorrect answers.
o [3, 10, 12, 21, 2]
o [3, 10, 12, 21, 3, 10, 12, 21] o [6, 20, 24, 42]
o array([6, 20, 24, 42])
12. What is the value of y after you evaluate seed(idnum); y = (rand(4)*10).astype(int); y = y * 2 in Spyder? Highlight the correct answer, or delete all incorrect answers.
o an array of 4 numbers o an array of 8 numbers o an array of 40 numbers o an array of 80 numbers
13. What is the value of seed(idnum); np.sqrt(randn()) evaluated in Spyder? Highlight the correct answer, or delete all incorrect answers.
o a number greater than one
o a number less than one but larger than zero o a number less than zero
o nan
o syntax error
14. How do you know that a p-value is significant? Highlight the correct answer, or delete all incorrect answers.
o if it is less than 0.5
o if it is less than 5%
o if it is less than 0.05
o if it is less than 0.001
o if it is smaller than the alpha level o all of the above except one
15. What does a statistically significant p-value for the Mann-Whitney U test imply? Highlight the correct answer, or delete all incorrect answers.
o there is evidence that two populations differ
o UA is less than UB
o the alpha value is less than 0.05
o the associated Kolmogorov-Smirnov test would also be significant o the associated Kolmogorov-Smirnov test would not be significant o the U statistic is greater than its critical value
16. If a distribution A statistically dominates a distribution B, will the Mann-Whitney U test between them always be significant? Highlight the correct answer, or delete all incorrect answers.
o Yes o No
17. Enter seed(idnum); p=(rand(1)/11)[0] into the Spyder Console. What is the value of p? 18. If you had obtained this value of p from a Kolmogorov-Smirnov test, would it reflect a
statistically significant result? Highlight the correct answer, or delete all incorrect answers. o Yes
o No
19. What is output when you enter seed(idnum); z = rand(100); z = z[z < 0.25]; np.round(sum(z),2)” in the Spyder Console? Highlight the correct answer, or delete all incorrect answers.o Nothingo A traceback describing a type erroro A number with one or two decimal places o A number with 15 decimal placeso 2.36o 1.13614364o 2.458493039499970220. Plot the empirical cumulative distribution function of z. How many steps are displayed on the graph?21. Considering the Mann-Whitney test and the Kolmogorov-Smirnov test, which has the greater statistical power to detect differences between distributions? Highlight the correct answer, or delete all incorrect answers.o Mann-Whitneyo Kolmogorov-Smirnovo They are equal in statistical powero They must be used in combination to test for differenceso Which is more powerful depends on the nature of the differences o Statistical power is an attribute of the analyst, not the test22. Suppose that the assignment “y = range(5)” has been made. How many elements does y have?23. What is range(5)? Highlight the correct answer, or delete all incorrect answers.o [1,5]o An array of 6 numberso [1,2,3,4,5]o [5]o [0,1,2,3,4,5]o [0,1,2,3,4]o Something elseo Nothing (undefined or not syntactical)24. What is RANGE(5)? Highlight the correct answer, or delete all incorrect answers.o [1,5]o an array of 6 numberso [1,2,3,4,5]o [5]o [0,1,2,3,4,5]o [0,1,2,3,4]o Something elseo Nothing (undefined or not syntactical)25. Enter the code “x = 0.001; y = 13; print(x+y)” in the Console. Then enter “def doit(x) : y = x + 1; return(np.exp(y))”. Finally, enter “print(doit(x)); print(‘Done’)”. What is the value of y after ‘Done’ is printed?26. What is the type of y? Highlight the correct answer, or delete all incorrect answers.o into floato listo stringo int32o float64 o function o module27. What is the type of doit? Highlight the correct answer, or delete all incorrect answers.o into floato listo stringo int32o float64 o function o module o Option 928. What is y + doit(x)?29. Consider the empirical distribution functions of two data sets (Orange and Blue) in the graph below. Which statement is true? Highlight the correct answer, or delete all incorrect answers.o Orange dominates Blueo Blue dominates Orangeo Neither distribution dominates the other 30. Can a random value from the Orange distribution be less than a random value from the Blue distribution? Highlight the correct answer, or delete all incorrect answers.o Yes o No31. Enter “seed(idnum); X = rand(30) * rand() * 10; Y = (randn(20) + 2) * rand() * 5; edf(X); edf(Y)”, where edf is a function that plots the empirical distribution function of a data set. Which of the following is true? Highlight the correct answer, or delete all incorrect answers.o X (blue) dominates Y (orange)o Y (orange) dominates X (blue)o Neither distribution dominates the other
Reviews
There are no reviews yet.