Question

Consider the file “PatientTemperature_CSV.csv” given to you representing patient body temperatures at a hospital on a...

Consider the file “PatientTemperature_CSV.csv” given to you representing patient body temperatures at a hospital on a particular day. The data is organized into two columns: patient temperature and patient age. Using code snippets available from the class lecture material or otherwise, perform the following tasks with this data in python: [80 points]

a) Read the data into Python [15 points]

b) Determine the mean, mode, median, variance, and standard deviation for the patient temperatures. [15 points]

c) Determine the mean, median, variance, and standard deviation for the patient ages. [15 points]

d) Determine the probability that a patient would have a body temperature greater than or equal to 97 F and lesser than or equal to 98 F. [15 points]

e) Plot a histogram of the temperature data. Please include a title and proper axes labels.[20 points]

Homework Answers

Answer #1

sample data

#PatientTemperature.csv

PatientTemperature,PatientAge
90,70
90,37
95,63
102,60
90,58
90,45
100,52
91,81
90,54
92,56
101,39
98,41
96,65
97,86
99,57
92,65
103,45
100,82
99,52
97,53
92,59
92,76
101,66
92,64
92,55
92,67
103,67
95,19
95,47
103,33
93,18
98,59
94,30
103,88
97,57
91,79
103,49
96,57
90,78
100,60
95,25
94,20
90,29
92,25
99,76
92,18
102,86
99,49
99,80
92,22
99,84
92,19
96,87
90,54
98,69
95,72
97,39
99,80
92,41
93,71
99,42
92,32
102,30
96,71
92,86
99,90
103,59
99,88
99,39
94,37
90,37
93,77
99,52
95,60
98,18
101,46
100,62
101,90
90,28
96,30
95,67
101,64
103,51
94,18
102,19
98,51
95,73
96,85
95,36
92,21
99,90
100,62
97,78
99,45
98,45
90,23
90,21
92,81
94,85
95,36
98,29
100,30
100,48
92,57
90,77
101,40
102,90
95,89
99,71
100,20
96,37
99,50
90,28
90,37
90,82
100,41
90,53
101,59
97,51
95,84
90,69
98,72
101,68
91,39
95,29
92,70
96,72
102,46
91,86
90,86
100,65
94,86
96,27
99,46
91,19
94,62
90,51
96,18
102,21
93,74

#source code:

import numpy as np
from scipy import stats
import pandas as pd
import matplotlib.pyplot as plt
data=pd.read_csv("PatientTemperature.csv") #read the data into data dataframe
print(data) #print the data

#mean,meadian,mode,variance,standard deviation of patientTemperature

print("Mean Temperature:",np.mean(data['PatientTemperature']))
print("Median Temperature:",np.median(data['PatientTemperature']))
print("Mode Temperature:",stats.mode(data['PatientTemperature']))
print("variance Temperature:",np.var(data['PatientTemperature']))
print("standard deviation Temperature:",np.std(data['PatientTemperature']))

print("\n")
#mean,meadian,mode,variance,standard deviation of patientage

print("Mean Age:",np.mean(data['PatientAge']))
print("Median Age:",np.median(data['PatientAge']))
print("Mode Age:",stats.mode(data['PatientAge']))
print("variance Age:",np.var(data['PatientAge']))
print("standard deviation Age:",np.std(data['PatientAge']))

#probability of the patientTemperature
size=data.shape
data_count=size[0]
count_p=0
for i in range(data_count):
   if(data['PatientTemperature'][i]>=97 and data['PatientTemperature'][i]<=98):
       count_p+=1
print("Probability:",count_p/data_count)

#histogram
plt.bar(data['PatientTemperature'],data['PatientAge'])
plt.xlabel("Temperature")
plt.ylabel("Age")
plt.show()   


#output:

#if you have any doubts comment below..if you like give thumbs up...

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
A random sample of 130 human body temperatures, provided in the Journal of Statistical Education, has...
A random sample of 130 human body temperatures, provided in the Journal of Statistical Education, has a mean of 98.25◦ F and a standard deviation of 0.73◦ F. A researcher named Violet believes that the commonly reported mean body temperature of 98.6◦ F is incorrect. In this problem, you will conduct a hypothesis t-test to test Violet’s claim and determine if the given data indicates that the average human body temperature is different from 98.6◦ F. (a) Verify that the...
Refer to the data set of body temperatures in degrees Fahrenheit given in the accompanying table...
Refer to the data set of body temperatures in degrees Fahrenheit given in the accompanying table and use software or a calculator to find the mean and median. Do the results support or contradict the common belief that the mean body temperature is 98.6°​F? 97.197.1 99.099.0 99.099.0 98.698.6 98.598.5 98.398.3 97.297.2 98.198.1 98.498.4 98.398.3 96.596.5 97.697.6 99.299.2 97.397.3 97.197.1 98.798.7 98.698.6 99.399.3 98.398.3 96.596.5 97.997.9 97.697.6 97.897.8 99.499.4 98.198.1 98.898.8 97.097.0 96.796.7 99.599.5 99.699.6 97.897.8 98.798.7 97.497.4 97.097.0 97.197.1 96.996.9...
Consider the following set of sample data, and find the following (note: if you are using...
Consider the following set of sample data, and find the following (note: if you are using TI 83 to find these values, you need to write down the formulas that you should have used) 19 12 9 19 0 4 3 14 5 5 24 2 5 7 17 (a). Mean (b). Median (c). Mode (d). Standard Deviation (e). Variance (f). Find the z-score for 14. (i). Construct a Box-whisker plot for the data (j). Construct a frequency distribution Table....
Data For Tasks 1-8, consider the following data: 7.2, 1.2, 1.8, 2.8, 18, -1.9, -0.1, -1.5,...
Data For Tasks 1-8, consider the following data: 7.2, 1.2, 1.8, 2.8, 18, -1.9, -0.1, -1.5, 13.0, 3.2, -1.1, 7.0, 0.5, 3.9, 2.1, 4.1, 6.5 In Tasks 1-8 you are asked to conduct some computations regarding this data. The computation should be carried out manually. All the steps that go into the computation should be presented and explained. (You may use R in order to verify your computation, but not as a substitute for conducting the manual computations.) A Random...
Example 1: Among females in the US in a given age cohort, a diastolic blood pressure...
Example 1: Among females in the US in a given age cohort, a diastolic blood pressure is normally distributed with mean µ = 95 mm Hg and standard deviation σ = 15 mm Hg. a) What is the probability that a randomly selected woman has a diastolic blood pressure less than 90 mm Hg? b) What is the probability that she has a diastolic blood pressure greater than 95 mm Hg? c) What is the probability that she has a...
Given the data 28.65 26.55 26.65 27.65 27.35 28.35 26.85 28.65 29.65 27.85 27.05 28.25 28.85...
Given the data 28.65 26.55 26.65 27.65 27.35 28.35 26.85 28.65 29.65 27.85 27.05 28.25 28.85 26.75 27.65 28.45 28.65 28.45 31.65 26.35 27.75 29.25 27.65 28.65 27.65 28.55 27.65 27.25 Determine (a) the mean, (b) the standard deviation, (c) the variance, (d) the coefficient of variation, and (e) the 90% confidence interval for the mean. (f) Construct a histogram. Use a range from 26 to 32 with increments of 0.5. (g) Assuming that the distribution Thus, the improved estimates...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT