Plot Z-Score in R Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Z-scores are utilized to quantify the relationship of a value to the mean of a data set. Plots of z-scores within R visualize how values are removed from the mean. This article is a guide for calculating and plotting z-scores in R.A z-score is the number of standard deviations a value is away from the mean. The z-score formula is:Z = \frac{(X - \mu)}{\sigma}Where:X = individual valueμ = mean of the datasetσ = standard deviationA z-score of 1 indicates that the value is one standard deviation above the mean, and -1 indicates that it is one standard deviation below the mean.Method 1: Naive ApproachThis method consists of calculating the z-score by hand and plotting it.Steps:Make a vector of data values.Compute the mean and standard deviation.Compute the z-score for each point.Example 1: R a <- c(9, 10, 12, 14, 5, 8, 9) mean(a) # find standard deviation sd(a) # calculate z a.z <- (a - mean(a)) / sd(a) plot(a.z, type="o", col="green") Output:Example 2: R a <- c(7, 9, 2, 4, 25, 18, 19) mean(a) # find standard deviation sd(a) # calculate z-score a.z <- (a - mean(a)) / sd(a) plot(a.z, type="o", col="green") Output:Method 2: Using qnorm()If provided with a p-value, the Z-Score can be determined using R's qnorm() function. The p-value is the probability that a value lies below some value.Syntax: qnorm(p-value)Approach:Call qnorm() function with required p-valuePlot z-score with the value so obtainedExample : R set <- qnorm(0.75) plot(set, type="o", col="green") Output: Comment More infoAdvertise with us Next Article Qplot in R A akhilsharma870 Follow Improve Article Tags : R Language R-plots R-Charts R-Graphs R-Statistics +1 More Similar Reads Qplot in R Here, we will look working of Qplot in R Programming using Qplot function. The basic plot() function from the R base package and the function Qplot are extremely similar. It can be used to quickly construct and combine several plot kinds. It is still less customizable than the function ggplot(). Let 4 min read Plot Only Text in R In this article, we will discuss how to plot only text in the R programming language. Method 1: Using par() function with the mar argument In this approach to plot only text, the user needs to call the in-built function par function with the mar argument to simply plot the empty plot in the R progra 3 min read Scatter Plot using Plotly in R A scatter plot in R is a graphical tool used to display the relationship between two continuous variables. Each point represents one observation, with its position determined by values on the x and y axes.Uses of Scatter PlotWe can use a scatter plot for the followingTo observe the relationship betw 5 min read Scatter plots in R Language A scatter plot is a set of dotted points representing individual data pieces on the horizontal and vertical axis. In a graph in which the values of two variables are plotted along the X-axis and Y-axis, the pattern of the resulting points reveals a correlation between them.We can create a scatter pl 3 min read Can Z Score be Negative A Z score, also known as a standard score, measures how many standard deviations a data point is from the mean. In this article, we will explore the concept of Z scores, the significance of negative Z scores, and their applications in various fields such as finance, psychology, and research. Whether 5 min read Set Axis Limits of Plot in R In this article, we will be looking at the approach to set the axis limits of the plot in R programming language. Axis limit of the plot basically refers to the scaling of the x-axis and the y-axis of the given plot. Using xlim and ylim arguments of the plot function In this approach to set the axi 3 min read Like