QUIZ 1: STAB57H3 - An Introduction to Statistics
FIRST NAME:
LAST NAME:
STUDENT NUMBER:
TUTORIAL:
Problem 1: The following data were generated from an N (, 1) distribution by a student.
Unfortunately, the student forgot which value of was used, so we are
gmacro
SampleSizeTConfInt
#This is a MINITAB macro calculates the sample size for t CIs for the difference
#between two population means. See p321 Evans and Rosenthal for details.
#To run this macro just save it in some folder and open minitab
#and at th
STAB57: Quiz-9
[All relevant work must be shown for full credit]
Name:
Student number:
The sponsors of television shows targeted at the childrens market wanted to know
the amount of time children spend watching television, since the types and numbers
of p
Reading data from a file
wtloss=scan("C:/Users/Owner/Desktop/wtloss.txt")
#This command reads data from the file wtloss.txt
# The file path is differnt in different computers
Summary of the data set
summary(wtloss)
# This command summarizes the data in wt
10.3.2 Simple linear regression p540
In simple linear regression we assume
E(Y | X x) x
12
Estimation of parameters
Given n observations on the explanatory variable x
the response variable y,
(x , y ),(x , y ),(xn, yn)
11 2 2
b is estimated by
2
n
n
( xi
UNIVERSITY OF TORONTO SCARBOROUGH
Department of Computer and Mathematical Sciences
Midterm Test, February 2013
STAB57H3 Introduction to Statistics
Duration: One hour and fty minutes
Last Name:
First Name:
Student number:
Aids allowed:
- The textbook (Prob
UNIVERSITY OF TORONTO SCARBOROUGH
Department of Computer and Mathematical Sciences
ACTB40 Fundamentals of Investment & Credit
Sample Test
Duration 1 hour 45 minutes
Examination aids allowed: Scientific Calculator
Last Name:
First Name:
Student #:
_
_
_
In
class Person():
' A class to represent a human being'
def _init_(self, name, age, gender):
'(Person) -> NoneType
Creates a new person
'
print('I am creating a new person')
self._name = name
self._age = age
if(gender ='M'):
self._is_male = True
else:
self.
'Week 9 INHERITANCE
Assosiation:
one obj holds another as a variable
example: A Dog has-a Toy
Composition:
one object is made up of many other objects
part-of relationship
example: a room is part of a building
inheritance
one object is a specific case of
my_string = 'Hello World'
#with a while loop
#nned a variable to tell us where we are in the string
letter_index = 0
#while we're still in the string
while (letter_index <= len(my_string):
#if the index is even, print the letter
if (letter_index % 2) = 0)
10.3.2 Simple linear regression
In simple linear regression we assume
E(Y | X = x) = + x
12
Estimation of parameters
Given n observations on the explanatory variable x
the response variable y,
( x , y ),( x , y ),( xn, yn )
11 2 2
b is estimated by
2
n
n
STAB57: Quiz-10 Solutions
[All relevant work must be shown for full credit]
Name:
Student number:
Suppose that we have observed a sample: x1 , x20 from a N (, 22 ) and found that x =
5.567 and s = 2.05. Let 21 be another independent observation from the s
Chi-squared test for independence of
two categorical variables
Table <- matrix(c(24,9,13,289, 100, 565), 2, 3, byrow=TRUE)
rownames(Table) <- c('Flu', 'No Flu')
colnames(Table) <- c('No Vac', 'One shot', 'Two shots')
Table
chisq.test(Table)
Here is the R
5.3 Statistical Models p247
In a statistical problem, we observe data s,
but we are uncertain about P. We want to
construct inferences about P.
We assume that there is a random
mechanism generating s and we know that
the corresponding probability measure
R code for example 9.1.2 p482
#Example 9.1.2 p482
n = 5 # sample size in this example
rep=100000
d=c(1:rep) # just define an arbitrary initial vector
for(i in 1:rep) cfw_
s=rnorm(n,mean=0,sd=1)
#print(s)
r=(s-mean(s)/sd(s)
#print(r)
d1=log(r^2)/(n-1)
d[i]
UNIVERSITY OF TORONTO AT SCARBOROUGH
UNIVERSITY OF TORONTO AT SCARBOROUGH
SAMPLE FINAL EXAM
STAB57
Duration - 3 hours
THIS EXAM IS OPEN BOOK (NOTES)
AIDS ALLOWED: Non-communicating calculator
LAST NAME_
FIRST NAME_
STUDENT NUMBER_
All relevant work MUST b
Ex.
Degree of Reading Power (DRP) scores
for 44 students. Assume that the
population standard deviation is 11.0.
95% CI for the population mean score
is given in the MINITAB output below.
DRP Scores
40
19
31
49
27
26
47
46
28
14
39
19
52
52
54
14
26
25
47
10.3.2 Simple linear regression
In simple linear regression we assume
E(Y | X = x) = + x
12
Estimation of parameters
Given n observations on the explanatory variable x
the response variable y,
( x , y ),( x , y ),( xn, yn )
11 2 2
b is estimated by
2
n
n
UNIVERSITY OF TORONTO SCARBOROUGH
Department of Computer and Mathematical Sciences
FINAL EXAMINATION, APRIL 2012
STAB57H3 Introduction to Statistics
Duration: 3 hours
First Name:
Last Name:
Student number:
Aids allowed:
- The textbook (Probability and Sta
import math
class Parallelogram():
'A class to represent a parallelogram'
def _init_(self, base, side, theta):
'(Parallelogram, float, float, float) -> None Type'
self._base = base
self._side = side
self._theta = theta
self._name = 'Parallelogram'
def are
my_string = 'Hello World'
#with a while loop to tell us
#need a variable to tell us where we at in the string
letter_index = 0
upper_count = 0
lower_count = 0
#check if its upper/lower case,update the counter
while (letter_index < len(my_string):
next_let
QUIZ 5: STAB57H3 - An Introduction to Statistics
FIRST NAME:
LAST NAME:
STUDENT NUMBER:
TUTORIAL:
Problem 1: Let a random sample of size 17 from the normal distribution N (, 2 ) yield
x = 4.7 and s2 = 5.76. Determine a 0.90-condence interval for .
[5 Poin
QUIZ 6: STAB57H3 - An Introduction to Statistics
FIRST NAME:
LAST NAME:
STUDENT NUMBER:
TUTORIAL:
Problem 1: Let (x1 , x2 , , xn ) be a random sample from an Exponential() distribution. Consider that the prior distribution of is Gamma(0 , 0 ). Find the di
QUIZ 7: STAB57H3 - An Introduction to Statistics
FIRST NAME:
LAST NAME:
STUDENT NUMBER:
TUTORIAL:
Problem 1: The concentration of mercury (milligrams per cubic meter) is a random variable
(say X) having a N (, 0.52 ) where N (1.5, 0.72 ). A sample of 11 m
UNIVERSITY OF TORONTO SCARBOROUGH
Department of Computer and Mathematical Sciences
Midterm Test, Winter - 2017
STAB57H3: An Introduction to Statistics
Duration: Two hours (120 minutes)
LAST NAME:
FIRST NAME:
STUDENT NUMBER:
SIGNATURE:
TUTORIAL:
Aids Allow
UNIVERSITY OF TORONTO SCARBOROUGH
Department of Computer and Mathematical Sciences
Midterm Test, Winter - 2017
STAB57H3: An Introduction to Statistics
Duration: Two hours (120 minutes)
LAST NAME:
FIRST NAME:
STUDENT NUMBER:
SIGNATURE:
TUTORIAL:
Aids Allow