Sir Calvin Gaye
2024-07-17
After completing this chapter, you should be able to
To describe situations, draw conclusions, or make inferences about events, the researcher must organize the data.
The researcher presents data so they can be understood by those who will benefit from reading the study.
library(flextable)
library(tidyverse)
library(formattable)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ purrr::compose() masks flextable::compose()
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Attaching package: 'formattable'
The following object is masked from 'package:flextable':
style
Attaching package: 'gt'
The following object is masked from 'package:formattable':
currency
Loading required package: reactable
Attaching package: 'reactablefmtr'
The following objects are masked from 'package:gt':
google_font, html
The following object is masked from 'package:ggplot2':
margin
The following object is masked from 'package:flextable':
void
X1 | X2 | X3 | X4 | X5 |
|---|---|---|---|---|
45 | 46 | 64 | 57 | 85 |
92 | 51 | 71 | 54 | 48 |
27 | 66 | 76 | 55 | 69 |
54 | 44 | 54 | 75 | 46 |
61 | 68 | 78 | 61 | 83 |
88 | 45 | 89 | 67 | 56 |
81 | 58 | 55 | 62 | 38 |
55 | 56 | 64 | 81 | 38 |
49 | 68 | 91 | 56 | 68 |
46 | 47 | 83 | 71 | 62 |
A frequency distribution is the organization of raw data in table form, using classes and frequencies.
Each raw data value is placed into a quantitative or qualitative category called a class.
The frequency of a class then is the number of data values contained in a specific class..
Class_limits | FrequencyRD |
|---|---|
27-35 | 1 |
36-44 | 2 |
45-53 | 9 |
54-62 | 15 |
63-71 | 10 |
72-80 | 3 |
81-89 | 7 |
90-98 | 2 |
Total | 50 |
X1 | X2 | X3 | X4 | X5 | X6 | X7 | X8 | X9 | X10 |
|---|---|---|---|---|---|---|---|---|---|
W | J | C | C | J | C | T | W | C | T |
W | M | M | W | W | M | W | W | M | C |
T | W | J | M | M | C | J | C | M | W |
W | C | W | W | J | W | W | M | C | J |
classBB | frequencyBB | percentBB | cum.frequencyBB |
|---|---|---|---|
W |
|
|
|
M |
|
|
|
J |
|
|
|
C |
|
|
|
T |
|
|
|
Step 2 Count the tallies and place the results in the third column labeled Frequency.
Step 3 Find the percentage of values in each class by using the formula:
\[ \% = \frac{f}{n}\] where \(f = \text{frequency}\) of the class and \(n = \text{total number of values}\). For example, in class W, the percentage is
\[ = \frac{14}{40}\times 100 = 35\% \]
\[ 35\%, 35+20=55\%, 35+20+15 = 70\% ... \]
classBB | frequencyBB | percentBB | cum.frequencyBB |
|---|---|---|---|
W | 14 | 35.0 | 35.0 |
M | 8 | 20.0 | 55.0 |
J | 6 | 15.0 | 70.0 |
C | 9 | 22.5 | 92.5 |
T | 3 | 7.5 | 100.0 |
When the range of the data is large, the data must be grouped into classes that are more than one unit in width, in what is called a grouped frequency distribution.
For example, a distribution of the blood glucose levels in milligrams per deciliter (mg/dL) for 50 randomly selected college students is shown.
In this distribution, the values 58 and 64 of the first class are called class limits.
The lower class limit is 58; it represents the smallest data value that can be included in the class.
The upper class limit is 64; it represents the largest data value that can be included in the class.
The numbers in the second column are called class boundaries.
The basic rule of thumb is that the class limits should have the same decimal place value as the data, but the class boundaries should have one additional place value and end in a 5.
The class width for a class in a frequency distribution is found by subtracting the lower (or upper) class limit of one class from the lower (or upper) class limit of the next class.
The researcher must decide how many classes to use and the width of each class. To construct a frequency distribution, follow these rules:
There should be between 5 and 20 classes.
It is preferable but not absolutely necessary that the class width be an odd number. This ensures that the midpoint of each class has the same place value as the data. The class midpoint \(X_m\) is obtained by adding the lower boundary(lb) and upper boundary(ub) and dividing by 2, or adding the lower limit(ll) and upper limit(ul) and dividing by 2: \[ X_{m} = \frac{lb + up}{2}\]
or
\[X_{m} = \frac{ll + ul}{2}\]
The classes must be mutually exclusive.
The classes must be continuous.
The classes must be exhaustive.
The classes must be equal in width. One exception occurs when a distribution has a class that is open-ended. A frequency distribution with an open-ended class is called an open-ended distribution.