Posts

Showing posts from March, 2023

Probability: Normal Distribution

 Normal Distribution DataSet: https://drive.google.com/file/d/1eggLsBKx_RIK8_m0CHLHu2zAtZlrR3aG/view?usp=share_link Generate a Normal Distribution We can use the rnorm() function in R to generate random values from a normal distribution with a specified mean and standard deviation. The syntax of the function is: rnorm (n, mean = 0 , sd = 1 ) where n is the number of values to generate, mean is the mean of the distribution, and sd is the standard deviation of the distribution. For example, to generate 1000 random values from a normal distribution with a mean of 0 and a standard deviation of 1, we can use the following code: set .seed( 123 ) # set a seed for reproducibility x <- rnorm( 1000 , mean = 0 , sd = 1 ) The set.seed() function is used to set a seed value for the random number generator, which ensures that the same set of random numbers will be generated each time the code is run. This can be useful for reproducibility. Plot a Histogram of the Distribution We can us...