Question
reproduce the output in p.75 and figure p.77(use Python )

Table 3.1: headsize data. Head Size Data. 157 195 163 176 146 head1 breadth1 head2 breadth 2 head1 breadth1 head2 breadth 2 1
3.10 Some examples of the application of principal components analysis 75 R> head_dat <- headsize, c(head1, head2)] R> co
77 3.10 Some examples of the application of principal components analysis R>al<-183.84-0.721-185. 72/0.693 R> bi<-0.721/0.693


185 163 149 183 176 148 head1 breadth1 head2 breadth2 head1 breadth1 head2 breadth2 191 155 179 145 190 159 195 157 195 14920
R> head_dat <- headsize, c(head1, head2)] R> colMeans (head_dat) headi head2 185.7 183.8 R> cov (head_dat) head1 head2 he
R>al<-183.84-0.721185. 72/0.693 R> bi<-0.721/0.693 R> a2-183.84-(-0.693*185. 72/0.721) R> b2--0.693/0.721 R> plot (head_dat,

compute the principle ( read the R -code ) and do it on python with figure

just convert the code to python

I want to do it in Python program, please don't waste my time just tell me exactly you want
0 0
Add a comment Improve this question Transcribed image text
Answer #1

import matplotlib.pyplot as plt
import numpy as np

head1 = ([191,195,181,183,176,208,189,197,188,192,179,183,174,190,188,163,195,186,181,175,192,174,176,197,190])
head2 = ([179,201,185,188,171,192,190,189,197,187,186,174,185,195,187,161,183,173,182,165,185,179,176,200,187])

a1 = 183.84-0.721*185.72/0.693
b1 = 0.721/0.693
a2 = 183.84 - (-0.693*185.72/0.721)
b2 = -0.693/0.721


x = np.linspace(min(head1),max(head1),5)
plt.scatter(head1,head2)
plt.plot(x,a1 + b1*x)
plt.plot(x,a2 + b2*x,linestyle= '--')
plt.xlabel("First son's head length (mm)")
plt.ylabel("Second son's head length")
plt.show()

In [20]: import matplotlib.pyplot as plt import numpy as np head1 = ([191,195,181,183,176,208,189,197,188,192,179, 183, 174,

Add a comment
Know the answer?
Add Answer to:
reproduce the output in p.75 and figure p.77(use Python ) compute the principle ( read the...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please help me with this problem urgently. Please provide the solution both mathematically and in R...

    Please help me with this problem urgently. Please provide the solution both mathematically and in R code 3.21 The data in Table 3.8 consist of head measurements on first and second sons (Frets 1921). Define yi and y2 as the measurements on the first son and xi and 2 for the second son. (a) Find the mean vector for all four variables and partition it into ( as in (3.41). (b) Find the covariance matrix for all four variables and...

  • Maintaining a healthy weight is important for women’s health. Some physicians recommend being back to your...

    Maintaining a healthy weight is important for women’s health. Some physicians recommend being back to your pre-pregnancy weight six months after giving birth. Public health officials are interested in whether this is a realistic goal. Do the women in North Carolina weigh more than their pre-pregnancy weight six months postpartum? In other words, is the six months post-pregnancy weight greater than their pre-pregnancy weight? Use a paired samples t-test to compare pst6wght (variable 1) and prewght (variable 2). This uses...

  • You are the Operations Manager for a trailer manufacturing company On the Plant Information tab y...

    You are the Operations Manager for a trailer manufacturing company On the Plant Information tab you have the production results from 2 manufacturing plants that belong to your company The two plants make the same trailers and have very similar people and processes, but the number of trailers they produce each day is not the same The company President has told you that she is worried about production. She gives you no other details about what "worried" means You decide...

  • I need help with my applied managerial statistics project Do a descriptive analysis(calculate mean, mode ,range...

    I need help with my applied managerial statistics project Do a descriptive analysis(calculate mean, mode ,range ,variance ,std ,deviation etc ) on each of the four variables sales ,calls, time, years and plot a histogram (using Excel)for each of the four variables. B Sales (Y) 37 38 40 117 45 43 34 37 137 138 44 45 37 38 43 46 45 Calls (X1) Time (X2) Years (X3) 117 14.8 117 15.3 15.6 117 15.8 120 18.2 120 13.6 131...

  • Your IT department provided you data on patients that received ER services, their GHHS, and their recovery time. Prepare a report to share with the owners of the facility that will help you make infor...

    Your IT department provided you data on patients that received ER services, their GHHS, and their recovery time. Prepare a report to share with the owners of the facility that will help you make informed decisions about how long you can expect a patients’ recovery time would be based on their GHHS. Based on your findings provide recommendations on your plan moving forward to improve the functioning of your facilities in generating revenue. Prepare a report that addresses each of...

  • For an Independent t-test, you can either: Perform all calculations by typing in formulas to compute...

    For an Independent t-test, you can either: Perform all calculations by typing in formulas to compute the needed components and answers You can use the "Data: Data Analysis: t-test: Two Sample Assuming Equal Variances" procedure Examples of this procedure can be found in your text, Excel Appendix 10.1, p. 459 For a Paired Differences t-test (dependent t-test), you can either Perform all calculations by typing in formulas to compute the needed components and answer. You can use the "Data: Data...

  • Design Column B2: KL 30, Use an HSS section, Fy 46 ksi. pe 0.9 Use table 10.5 from handout Calcul...

    Answer the following blanks for design column B2 Design Column B2: KL 30, Use an HSS section, Fy 46 ksi. pe 0.9 Use table 10.5 from handout Calculate the following: Column tributary area: Artb (At2) Total column load: Pu (kips)- Column nominal Load: Pr (Kkips)- Lightest Column Section: Column Selection Table Pu (kips)- BLE 10.5 Safe Factored Loads for Selected 46-ksi Yield Stress Tube Steel Columns Effective Length (KL) in feet Area (in.2) 06 8 10 12 14 16 18...

  • Complete the following four hypotheses, using α = 0.05 for each. The week 5 spreadsheet can...

    Complete the following four hypotheses, using α = 0.05 for each. The week 5 spreadsheet can be used in these analyses. 1. Mean sales per week exceed 42.5 per salesperson 2. Proportion receiving online training is less than 55% 3 Mean calls made among those with no training is at least 145 4. Mean time per call is 14.7 minutes Using the same data set from part A, perform the hypothesis test for each speculation in order to see if...

  • A partial payment is made on the date indicated. Use the United States rule to determine...

    A partial payment is made on the date indicated. Use the United States rule to determine the balance due on the note at the date of maturity. (The Effective Date is the date the note was written.) Assume the year is not a leap year. Effective Partial Payment Maturity Principal Rate Date Amount Date Date $4000 4% April 1 $1000 May 1 June 1 Click the icon to view a table of the number of the day of the year...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT