Question

In: Statistics and Probability

Q. Make a vector of weights in order from the youngest person to the oldest. What...

Q. Make a vector of weights in order from the youngest person to the oldest.

What is the code here? I should get a code in R program.

firstName gender age height weight bmi overWt
1 Tom m 77 70 175 25.16238799 TRUE
2 May f 33 64 125 21.50106395 FALSE
3 Joe m 79 73 185 24.45884214 FALSE
4 Bob m 47 67 156 24.4841414 FALSE
5 Sue f 27 64 105 18.06089372 FALSE
6 Liz f 33 68 190 28.94980625 TRUE
7 Jon m 67 68 185 28.18796924 TRUE
8 Sal f 52 65 124 20.67782511 FALSE
9 Tim m 59 68 175 26.66429523 TRUE
10 Tom m 27 71 215 30.04911241 TRUE
11 Ann f 55 67 166 26.05363764 TRUE
12 Dan m 24 66 140 22.64383859 FALSE
13 Art m 46 66 150 24.26125563 FALSE
14 Zoe f 48 62 125 22.91060301 FALSE

Solutions

Expert Solution

R codes and output:

> data=read.table('weight.csv',header=TRUE, sep=',')
> head(data)
firstName gender age height weight bmi overWt
1 Tom m 77 70 175 25.16239 TRUE
2 May f 33 64 125 21.50106 FALSE
3 Joe m 79 73 185 24.45884 FALSE
4 Bob m 47 67 156 24.48414 FALSE
5 Sue f 27 64 105 18.06089 FALSE
6 Liz f 33 68 190 28.94981 TRUE
> attach(data)
> data_1=data[order(age),] # this command sort data in ascending order by age
> data_1
firstName gender age height weight bmi overWt
12 Dan m 24 66 140 22.64384 FALSE
5 Sue f 27 64 105 18.06089 FALSE
10 Tom m 27 71 215 30.04911 TRUE
2 May f 33 64 125 21.50106 FALSE
6 Liz f 33 68 190 28.94981 TRUE
13 Art m 46 66 150 24.26126 FALSE
4 Bob m 47 67 156 24.48414 FALSE
14 Zoe f 48 62 125 22.91060 FALSE
8 Sal f 52 65 124 20.67783 FALSE
11 Ann f 55 67 166 26.05364 TRUE
9 Tim m 59 68 175 26.66430 TRUE
7 Jon m 67 68 185 28.18797 TRUE
1 Tom m 77 70 175 25.16239 TRUE
3 Joe m 79 73 185 24.45884 FALSE


Related Solutions

a.) In families of 4 offspring, what is the probability of finding the oldest and youngest...
a.) In families of 4 offspring, what is the probability of finding the oldest and youngest offspring to both be female? (As you calculate your response, keep variable rounded at 4 decimal places, provide your answer as a percentage with 2 decimal places, no percentage sign needed(%) i.e., 45.21) b.) Chestnut, Palomino, and Cremello coat coloring is horses is determined by a partial or incomplete dominant mode of inheritance. Chestnut (CC) and cremello (CCrCCr) animals have a homozygous genotype, and...
8.20 Person Pointer Function Make a function that will accept a pointer to a vector of...
8.20 Person Pointer Function Make a function that will accept a pointer to a vector of Person pointers as a parameter. Return a pointer to the Person with the highest salary. The function must be signatured like: Person* getBestPaid(vector*); The class definition is: class Person { public: double salary; string name; }; You may include code in your main() to test, but the tests in this assignment will ensure your code is correct. You may assume there will ways be...
1. What is your birth order in your family? First-born, middle child, youngest, etc.? 2. How...
1. What is your birth order in your family? First-born, middle child, youngest, etc.? 2. How does your birth order influence your attitude and behavior when working in groups? (Respecting group authority, sharing power, tendency toward groupthink, social loafing/over-responsibility, etc.) 3. What are your strengths that you can attribute to your birth order? 4. How can you leverage these strengths as a group member? 5. What are your weaknesses that you can attribute to your birth order? 6. How does...
Q) Explain the following, What are the following : 2nd order or frst order systsms and...
Q) Explain the following, What are the following : 2nd order or frst order systsms and their difference? Capacitor and inductor chargung and discharging? RL and RC and RLC filter?
What magnitude and sign of charge Q will make the force on charge q zero?
(Figure 1) shows four charges at the corners of a square of side L. What magnitude and sign of charge Q will make the force on charge q zero? Q =
In order for a person to collect from a life insurance policy, the beneficiary who purchases...
In order for a person to collect from a life insurance policy, the beneficiary who purchases the policy must have ___________ in the life of the insured.
What is the condition for light in order to make interference pattern from Young-double slit? How...
What is the condition for light in order to make interference pattern from Young-double slit? How do you make single source to make a source for young double-slit experiment? What happen if you use electron instead of light, what pattern you expect to see, and why? What are the parameters that can affect the interference pattern (mention at least 3)
These problems maybe from Newton's Law, Motion, Vector, and Work and Energy, make sure to use...
These problems maybe from Newton's Law, Motion, Vector, and Work and Energy, make sure to use the correct formula.  Round four decimal places throughout the entire problem and for the final answer for each problem. 1. A velocity vector 15 m/s has an angle 30 degree with x axis and another velocity vector 40 m/s, has an angle 90 degree with x axis. What is the angle of the resultant with reference first vector? Instruction - Take sine of your result...
5 people walk into a room in random order. What is the probability that no person...
5 people walk into a room in random order. What is the probability that no person is in correct alphabetical position? For instance, if it is 4 people A, B, C, and D, and they walk in the order B, D, C, A then person C, having walked in 3rd, did have the correct alphabetical position?
In order for integration with other physicians to be successful, what person is needed to arrange...
In order for integration with other physicians to be successful, what person is needed to arrange the financing of capital needs and to provide administrative leadership? A. Executive physician B. Physician liaison C. Managing physician D. Physician activist
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT