Question

In: Statistics and Probability

how to find the first, second, third quantile of a column in a dataset with R?...

how to find the first, second, third quantile of a column in a dataset with R?

the dataset is like this:

columns values

a. 1. 2. 3. 5. 6. 7. 4. 7. 8. .........

b 5. 6. 7. 3. 8. 0. 4. 7. 4. 7. .........

c    1. 2. 3. 5. 6. 7. 4. 7. 8. .........

d 6. 3. 1. 0. 8. 3. 6. 6. 3.........

Solutions

Expert Solution

a. 1, 2, 3, 5, 6, 7, 4, 7, 8.

The first quartile, or lower quartile, is the value that cuts off the first 25% of the data when it is sorted in ascending order. The second quartile, or median, is the value that cuts off the first 50%. The third quartile, or upper quartile, is the value that cuts off the first 75%.

R code:

> x<-c(1,2,3,5,6,7,4,7,8)
> quantile(x)
0% 25% 50% 75% 100%
1 3 5 7 8

The first, second and third quartile  are 3, 5 and 7 respectively.

b) 5, 6, 7, 3, 8, 0, 4, 7, 4, 7.

R-code:

>x<-c(5,6,7,3,8,0,4,7,4,7)
> quantile(x)
0% 25% 50% 75% 100%
0.0 4.0 5.5 7.0 8.0

The first, second and third quartile are 4, 5.5 and 7 respectively.

c)   1, 2, 3, 5, 6, 7, 4, 7, 8

R-code:

>x<-c(1,2,3,5,6,7,4,7,8)
> quantile(x)
0% 25% 50% 75% 100%
1 3 5 7 8

The first, second and third quartile are 3, 5 and 7 respectively.

d)  6, 3, 1, 0, 8, 3, 6, 6, 3

R-code:

>a<-c(6,3,1,0,8,3,6,6,3)
> quantile(a)
0% 25% 50% 75% 100%
0 3 3 6 8

The first, second and third quartile are 3, 3 and 6 respectively.


Related Solutions

In the census population density dataset, what are the first, second and third quartiles? 1,19,35,43,49,55,56,56,63,67,94,105,110,168,175,181,212,231,239,351,461,595,738,839,9857
In the census population density dataset, what are the first, second and third quartiles? 1,19,35,43,49,55,56,56,63,67,94,105,110,168,175,181,212,231,239,351,461,595,738,839,9857
The first column contains time in seconds and the second column the concentration of reactant in...
The first column contains time in seconds and the second column the concentration of reactant in molar units. e 0.0256 0.1 0.0195 0.2 0.0143 0.3 0.0105 0.45 0.0074 0.5 0.0066 0.6 0.0060 0.7 0.0031 0.8 0.0024 0.9 0.0031 1 0.0019 1.1 0.0022 1.2 0.0005 1.3 0.0012 1.4 0.0006 1.5 0.0009 What is the rate constant of the reaction? Be sure you include units. Use "M" for molar and "s" for seconds ? What is the rate of the reaction at...
Find the match up from the first column - the type of system calls to the second column - the categories normally supplied by the Operating System .
Find the match up from the first column - the type of system calls to the second column - the categories normally supplied by the Operating System .Get process, file, or device attributesWait event, signal eventAttach or detach remote devicesOpen file, close fileGet/set Device attributesA.Process ControlB.Information maintenanceC.File ManagementD.Device ManagementE.Communications
To find the dataset needed for this problem, you’ll first need to open the “swiss” dataset...
To find the dataset needed for this problem, you’ll first need to open the “swiss” dataset that is contained in R by running the following line: > data('swiss') Now you can rename the “swiss” dataset and use it to answer the question below. Name the data frame with your UT EID:                         > my_variable <- swiss This dataset contains socio-economic indicators for the French-speaking provinces of Switzerland in the year 1888. Among the variables, “Agriculture” is the percentage of the...
Which generation of quinolones are broad spectrum? First Second Third
Which generation of quinolones are broad spectrum? First Second Third
Describe direct, first, second, and third order control system.
Describe direct, first, second, and third order control system.
Find the cumulative frequencies for each class, and place the results in the third column.
Find the cumulative frequencies for each class, and place the results in the third column.
A stock provides dividend of $1 at the end of the first, second, and third year,...
A stock provides dividend of $1 at the end of the first, second, and third year, its spot price is $30 and the risk-free rate for all maturities (with continuous compounding) is 10%. What is the four year forward price? What is the value of this forward contract two years later if the forward price at that time is $40?
10. The following table states how many first, second and third class passengers aboard the Titanic...
10. The following table states how many first, second and third class passengers aboard the Titanic survived (and didn’t). Survived Did not Survive Total First Class 201 123 324 Second Class 118 166 284 Third Class 181 528 709 Total 500 817 1317 (a) What is the probability that a randomly chosen person was in first class? (b) What is the probability that a randomly chosen person was in first class and did not survive? (c) What is the probability...
QUESTION 5 In the diagnosis, "first, second, and third degree burns of the chest wall," a...
QUESTION 5 In the diagnosis, "first, second, and third degree burns of the chest wall," a code is required for: A. Each of the 1st, 2nd, and 3rd degree burns B. The 1st degree burn only C. The 3rd degree burn only D. The 2nd degree burn only 10 points    QUESTION 6 When coding for full-thickness free skin grafts, which of the following is not an essential item of data needed for accurate coding? A. Type of graft (full-thickness,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT