Statistical Analysis With R _Distributions_ Graphics — Part 1 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Statistical Analysis With R _Distributions_ Graphics — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What function in R is used to generate random numbers from a standard normal distribution?
Correct Answer: Option A — rnorm()
Detailed Academic Explanation:
rnorm() is the correct answer to “What function in R is used to generate random numbers from a standard normal distribution”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In R, how do you create a histogram for a numeric variable variable?
Correct Answer: Option C — geom_histogram(mapping = aes(x = variable))
Detailed Academic Explanation:
geom_histogram(mapping = aes(x = variable)) is the correct answer to “In R, how do you create a histogram for a numeric variable variable”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the qqnorm() function in R do?
Correct Answer: Option C — Creates a normal probability plot
Detailed Academic Explanation:
Creates a normal probability plot is the correct answer to “What does the qqnorm() function in R do”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you create a boxplot in R for a numerical variable named values?
Correct Answer: Option A — boxplot(values)
Detailed Academic Explanation:
boxplot(values) is the correct answer to “How do you create a boxplot in R for a numerical variable named values”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the density() function in R?
Correct Answer: Option B — Creates a density plot for a numeric variable
Detailed Academic Explanation:
Creates a density plot for a numeric variable is the correct answer to “What is the purpose of the density() function in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In R, how do you generate random numbers from a uniform distribution between 0 and 1?
Correct Answer: Option A — runif(n)
Detailed Academic Explanation:
runif(n) is the correct answer to “In R, how do you generate random numbers from a uniform distribution between 0 and 1”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the role of the ecdf() function in R?
Correct Answer: Option A — Computes the empirical cumulative distribution function
Detailed Academic Explanation:
Computes the empirical cumulative distribution function is the correct answer to “What is the role of the ecdf() function in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you create a scatter plot in R for two numeric variables x and y?
Correct Answer: Option C — geom_point(mapping = aes(x = x, y = y))
Detailed Academic Explanation:
geom_point(mapping = aes(x = x, y = y)) is the correct answer to “How do you create a scatter plot in R for two numeric variables x and y”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the hist() function in R?
Correct Answer: Option A — Creates a histogram for a numeric variable
Detailed Academic Explanation:
Creates a histogram for a numeric variable is the correct answer to “What is the purpose of the hist() function in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you create a probability plot in R for assessing the fit of a distribution to observed data?
Correct Answer: Option C — qqplot(data)
Detailed Academic Explanation:
qqplot(data) is the correct answer to “How do you create a probability plot in R for assessing the fit of a distribution to observed data”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In R, how do you compute the mean of a numeric variable named variable?
Correct Answer: Option A — mean(variable)
Detailed Academic Explanation:
mean(variable) is the correct answer to “In R, how do you compute the mean of a numeric variable named variable”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What function is used to calculate the cumulative distribution function (CDF) of a distribution in R?
Correct Answer: Option C — pbinom()
Detailed Academic Explanation:
pbinom() is the correct answer to “What function is used to calculate the cumulative distribution function (CDF) of a distribution in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you generate a normal probability plot in R for a numeric variable values?
Correct Answer: Option C — qqnorm(values)
Detailed Academic Explanation:
qqnorm(values) is the correct answer to “How do you generate a normal probability plot in R for a numeric variable values”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the boxplot() function in R?
Correct Answer: Option A — Creates a box-and-whisker plot for a numeric variable
Detailed Academic Explanation:
Creates a box-and-whisker plot for a numeric variable is the correct answer to “What is the purpose of the boxplot() function in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In R, how do you compute the median of a numeric variable named variable?
Correct Answer: Option A — median(variable)
Detailed Academic Explanation:
median(variable) is the correct answer to “In R, how do you compute the median of a numeric variable named variable”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the qqline() function in R do when used with a quantile-quantile plot?
Correct Answer: Option A — Adds a line to the quantile-quantile plot
Detailed Academic Explanation:
Adds a line to the quantile-quantile plot is the correct answer to “What does the qqline() function in R do when used with a quantile-quantile plot”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you generate a random sample from a binomial distribution in R with parameters n and p?
Correct Answer: Option A — rbinom(n, p)
Detailed Academic Explanation:
rbinom(n, p) is the correct answer to “How do you generate a random sample from a binomial distribution in R with parameters n and p”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What function is used to calculate the standard deviation of a numeric variable named variable in R?
Correct Answer: Option A — stdev(variable)
Detailed Academic Explanation:
stdev(variable) is the correct answer to “What function is used to calculate the standard deviation of a numeric variable named variable in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you create a quantile-quantile plot for a numeric variable values against a theoretical distribution in R?
Correct Answer: Option C — qqnorm(values, dist)
Detailed Academic Explanation:
qqnorm(values, dist) is the correct answer to “How do you create a quantile-quantile plot for a numeric variable values against a theoretical distribution in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In R, what is the purpose of the hist() function with the argument probability = TRUE?
Correct Answer: Option B — Plots a histogram with probabilities as heights
Detailed Academic Explanation:
Plots a histogram with probabilities as heights is the correct answer to “In R, what is the purpose of the hist() function with the argument probability = TRUE”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you create a kernel density plot in R for a numeric variable values?
Correct Answer: Option C — density_plot(values, kernel = TRUE)
Detailed Academic Explanation:
density_plot(values, kernel = TRUE) is the correct answer to “How do you create a kernel density plot in R for a numeric variable values”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the barplot() function in R?
Correct Answer: Option A — Creates a bar plot for a categorical variable
Detailed Academic Explanation:
Creates a bar plot for a categorical variable is the correct answer to “What is the purpose of the barplot() function in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you generate random numbers from a Poisson distribution in R with parameter lambda?
Correct Answer: Option A — rpois(lambda)
Detailed Academic Explanation:
rpois(lambda) is the correct answer to “How do you generate random numbers from a Poisson distribution in R with parameter lambda”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In R, what does the plot() function do when applied to a linear regression model?
Correct Answer: Option A — Plots the residuals against the fitted values
Detailed Academic Explanation:
Plots the residuals against the fitted values is the correct answer to “In R, what does the plot() function do when applied to a linear regression model”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you calculate the mode of a numeric variable named variable in R?
Correct Answer: Option A — mode(variable)
Detailed Academic Explanation:
mode(variable) is the correct answer to “How do you calculate the mode of a numeric variable named variable in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the role of the layout() function in R graphics?
Correct Answer: Option A — Organizes multiple plots in a grid layout
Detailed Academic Explanation:
Organizes multiple plots in a grid layout is the correct answer to “What is the role of the layout() function in R graphics”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In R, what does the polygon() function do when used in a plot?
Correct Answer: Option A — Draws a polygon on the plot
Detailed Academic Explanation:
Draws a polygon on the plot is the correct answer to “In R, what does the polygon() function do when used in a plot”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you create a stem-and-leaf plot for a numeric variable values in R?
Correct Answer: Option C — geom_stemleaf(mapping = aes(x = values))
Detailed Academic Explanation:
geom_stemleaf(mapping = aes(x = values)) is the correct answer to “How do you create a stem-and-leaf plot for a numeric variable values in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the pairs() function in R?
Correct Answer: Option B — Generates pairwise scatter plots and correlations
Detailed Academic Explanation:
Generates pairwise scatter plots and correlations is the correct answer to “What is the purpose of the pairs() function in R”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you create a time series plot in R for a numeric variable values with corresponding time points time?
Correct Answer: Option C — geom_line(mapping = aes(x = time, y = values))
Detailed Academic Explanation:
geom_line(mapping = aes(x = time, y = values)) is the correct answer to “How do you create a time series plot in R for a numeric variable values with corresponding time points time”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following will be used in fancy plots?
Correct Answer: Option A — New = T
Detailed Academic Explanation:
New = T is the correct answer to “Which of the following will be used in fancy plots”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
ask=T is a parameter that R asks before producing the . . . . . . . .
Correct Answer: Option D — graphics
Detailed Academic Explanation:
graphics is the correct answer to “ask=T is a parameter that R asks before producing the . . . . . . . .”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The graphical parameter . . . . . . . . defines how many lines appear in each of the four margins.
Correct Answer: Option B — Mar
Detailed Academic Explanation:
Mar is the correct answer to “The graphical parameter . . . . . . . . defines how many lines appear in each of the four margins.”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In which year Haykin gave a comprehensive survey of neural network techniques from an engineering perspective?
Correct Answer: Option D — 1994
Detailed Academic Explanation:
1994 is the correct answer to “In which year Haykin gave a comprehensive survey of neural network techniques from an engineering perspective”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which function is used to simulate discrete uniform random variables?
Correct Answer: Option A — Sample
Detailed Academic Explanation:
Sample is the correct answer to “Which function is used to simulate discrete uniform random variables”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which function draws an axis on the current plot?
Correct Answer: Option A — axis()
Detailed Academic Explanation:
axis() is the correct answer to “Which function draws an axis on the current plot”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following declares the current plot undeclared?
Correct Answer: Option B — New = T
Detailed Academic Explanation:
New = T is the correct answer to “Which of the following declares the current plot undeclared”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The . . . . . . . . and . . . . . . . . of a discrete random variable is easy to compute at the console.
Correct Answer: Option A — Mean, Variance
Detailed Academic Explanation:
Mean, Variance is the correct answer to “The . . . . . . . . and . . . . . . . . of a discrete random variable is easy to compute at the console.”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The . . . . . . . . package has functionality to investigate transformations of univariate distributions.
Correct Answer: Option C — Distr
Detailed Academic Explanation:
Distr is the correct answer to “The . . . . . . . . package has functionality to investigate transformations of univariate distributions.”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . gives the length and height of the current figure in inches.
Correct Answer: Option B — Fin
Detailed Academic Explanation:
Fin is the correct answer to “. . . . . . . . gives the length and height of the current figure in inches.”. This question is standard in competitive examination syllabi for Statistical Analysis With R _Distributions_ Graphics.
💡Key Conceptual Anchor:Statistical Analysis With R _Distributions_ Graphics
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.