FBISE, NCP & NBF-aligned resources for Classes 9–12
Browse by Class
Browse by Type
Computer Chapter 4 : Topic 3.7
Frequency Tables in RStudio
1 / 14
Which $\mathbf{R}$ function is commonly used to create a basic frequency table from categorical data?
Reasoning: $\mathbf{table()}$ counts how many times each unique value occurs.
2 / 14
What does a frequency table mainly show when summarizing categorical or discrete data in RStudio?
Reasoning: A frequency table shows the number of observations belonging to each category or value.
3 / 14
Why are frequency tables useful before creating charts or performing further statistical analysis in RStudio?
Reasoning: Frequency tables summarize data distribution and help identify common or uncommon categories.
4 / 14
Which type of data is most suitable for direct summarization using a simple frequency table?
Reasoning: Frequency tables are especially useful for counting occurrences of categories or discrete values.
5 / 14
What is the main difference between frequency and relative frequency in tables created using $\mathbf{R}$?
Reasoning: Frequency gives actual counts, while relative frequency expresses each count as a proportion of total observations.
6 / 14
Which $\mathbf{R}$ function is commonly combined with $\mathbf{table()}$ to calculate relative frequencies from category counts?
Reasoning: $\mathbf{prop.table()}$ converts the counts in a frequency table into proportions or relative frequencies.
7 / 14
Why should missing values be considered when creating frequency tables from real datasets in RStudio?
Reasoning: Missing values may be excluded from counts unless handled explicitly, potentially affecting the frequency summary.
8 / 14
What frequency counts does the $\mathbf{R}$ command $\mathbf{table(c('A','B','A','C','A')}$ produce when executed inside RStudio software correctly?
Reasoning: A occurs three times, while $\mathbf{B}$ and $\mathbf{C}$ each occur once.
9 / 14
Which code correctly creates a frequency table for variable grade stored in a dataframe students?
Reasoning: $\mathbf{table(students\$ grade)}$ counts each unique value in the grade column.
10 / 14
Which $\mathbf{R}$ command correctly converts the frequency table $\mathbf{table(x)}\mathbf{\ }$into proportions instead of raw counts?
Reasoning: $\mathbf{prop.table()}$ divides individual frequencies by the total frequency to produce proportions.
11 / 14
What does the command $\mathbf{sort(table(x),\ decreasing = TRUE)}$ do when used with categorical data values in RStudio?
Reasoning: table($\mathbf{x}$) calculates frequencies, while $\mathbf{sort(...,\ decreasing = TRUE)}$ arranges them from highest to lowest.
12 / 14
Which code includes missing values while creating a frequency table for vector$\mathbf{\ x\ }$in RStudio?
Reasoning: $\mathbf{useNA = "ifany"}\ $includes an $\mathbf{NA}$ category when missing values are present.
13 / 14
What does $\mathbf{addmargins(table(gender,\ result))}\mathbf{\ }$add to a two-way frequency table containing data in RStudio software?
Reasoning: $\mathbf{addmargins()}$ adds total frequencies across rows and columns of a two-way frequency table.
14 / 14
Which command creates a two-way frequency table using gender and result variables from dataframe $\mathbf{df}$?
Reasoning: Providing two variables to $\mathbf{table()}$ creates a two-way frequency table showing their combined frequencies.
Your score is
Restart quiz