Question

In: Statistics and Probability

Code using R or Python We observe from our campus the temperature and count the number...

Code using R or Python

We observe from our campus the temperature and count the number of squirrels. Our observations are

T = [52, 52, 50, 54, 50, 52, 54, 80, 80]

Sq = [8, 10, 6, 9, 6, 12, 12, 1, 0]

a) What is the covariance of these vectors? (1point)

b) What is the covariance matrix? (1point)

c) What is the correlation coefficient? (1point)

d) Find the coefficient of determination? (1point)

e) Can you make any statement or conclusion given these numbers as to the relationship of these paired observations? (1point)

f) If we try to fit a straight line model to these variables; What is the best choice 1 for the dependent and independent variable and why? What is the slope β1 ? What is the intercept value β0 ? (show your working) (4points)

g) Which aspect of the data is not being captured and does this affect the methodology of the straight line model used? (2points)

h) What is a good measure to assess the quality of the straight line fitted above? Use this measure. (1point)

Solutions

Expert Solution


Related Solutions

Python. Write a code that asks the user to enter a string. Count the number of...
Python. Write a code that asks the user to enter a string. Count the number of different vowels ( a, e, i, o, u) that are in the string and print out the total. You may need to write 5 different if statements, one for each vowel. Enter a string: mouse mouse has 3 different vowels
In python Using the example code from the HangMan program in our textbook, create a Word...
In python Using the example code from the HangMan program in our textbook, create a Word Guessing Game of your choice. Design a guessing game of your own creation. Choose a theme and build your words around that theme. Keep it simple. Note: I would highly recommend closely reviewing the HangMan code and program from Chapter 10 before starting work on this project. You can run the program via my REPL (Links to an external site.). Using python Similar to...
PYTHON PROBLEM: TASKED TO FIND THE FLAW WITH THE FOLLOWING CODE: from itertools import count def...
PYTHON PROBLEM: TASKED TO FIND THE FLAW WITH THE FOLLOWING CODE: from itertools import count def take_e(n, gen):     return [elem for (i, elem) in enumerate(gen) if i < n] def take_zc(n, gen):     return [elem for (i, elem) in zip(count(), gen) if i < n] FIBONACCI UNBOUNDED: def fibonacci_unbounded():     """     Unbounded Fibonacci numbers generator     """     (a, b) = (0, 1)     while True:         # return a         yield a         (a, b) = (b, a + b) SUPPOSED TO RUN THIS TO ASSIST WITH...
In Python we will be using the below code for the problem: rainfile=open('rainfall.txt') for line in...
In Python we will be using the below code for the problem: rainfile=open('rainfall.txt') for line in rainfile: values = line.split() #print(values) print (values[0], 'had', values[1], 'inches of rain.') rainfile.close( ) The following is the text from rainfall.txt Akron 26.81 Albia 37.65 Algona 30.69 Allison 33.64 Alton 27.43 AmesW 34.07 AmesSE 33.95 Anamosa 35.33 Ankeny 33.38 Atlantic 34.77 Audubon 33.41 Beaconsfield 35.27 Bedford 36.35 BellePlaine 35.81 Belleveu 34.35 Blocton 36.28 Bloomfield 38.02 Boone 36.30 Brighton 33.59 Britt 31.54 Buckeye 33.66 BurlingtonKBUR...
"PYTHON" Write some code " USING PYTHON" to keep reading numbers from the user until the...
"PYTHON" Write some code " USING PYTHON" to keep reading numbers from the user until the users enters a negative number. The program then prints out: a) the sum of all the numbers b) the average of all the numbers c) the max of the numbers d) the min of the numbers Note we did not cover lists (array) so you will not use them in this problem. Finally, ask the user for their name, then print their name as...
This is using Python, it is utilizing code from a Fraction class to create a Binary...
This is using Python, it is utilizing code from a Fraction class to create a Binary Class Please leave comments so I may be able to learn from this. Instruction for Binary Class: Exercise 6.18: Design an immutable class BinaryNumber, in the style of our Fraction class. Internally, your only instance variable should be a text string that represents the binary value, of the form '1110100'. Implement a constructor that takes a string parameter that specifies the original binary value....
Python...Count the number of times a element of list1 occurs in in list2 list1 = ['a',...
Python...Count the number of times a element of list1 occurs in in list2 list1 = ['a', 'b', 'c','e','j']; list2 = ['a', 'c', 'd', 'b','e','z']; {'a': 1, 'c': 1, 'b': 1, 'e': 1, 'j': 0} How do I get to this to work without the Collections counter?
Given a string, such as x = ‘itm330’, write a Python program to count the number...
Given a string, such as x = ‘itm330’, write a Python program to count the number of digits and the number of letters in it. For example, in ‘itm330’, there are 3 letters and 3 digits. Hint: Very similar to page 11 on the slides. To check if a character c is a digit, use c.isdigit(). If c is a digit, c.isdigit() will be a True.
An experiment is conducted to observe the room temperature. Assume the temperature can vary from 0...
An experiment is conducted to observe the room temperature. Assume the temperature can vary from 0 oF to 100 oF. A collection of 6 measurements of temperature in a classroom during May is given below. Meas.# 1 2 3 4 5 6 Temperature 34 79 91 38 46 20 oF (a) Define the sample space for the measurements. (b) Find at least two statistical measures for location. Indicate which one is preferred. (c) Find the variance and standard deviation. (d)...
R Programming: create a vector for 1 to 31 and count the number of even and...
R Programming: create a vector for 1 to 31 and count the number of even and odds using ifelse()
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT