Compute Randomly Drawn F Density in R Programming – rf() Function
Last Updated :
25 Jun, 2020
rf() function in R Language is used to compute random density for F Distribution.
Syntax: rf(N, df1, df2)
Parameters:
N: Sample Size
df: Degree of Freedom
Example 1:
set.seed(1000)
N <- 20
y <- rf(N, df1 = 2, df2 = 3)
y
Output:
[1] 0.2254501 19.1565944 0.1462503 0.1443822 0.5184883 0.9231497
[7] 4.0047848 1.5749135 1.8080354 0.6584719 2.5080273 0.8327536
[13] 0.9125265 7.8437920 4.8880169 0.1858029 0.2296163 12.4537679
[19] 0.4680668 12.6245564
Example 2:
set.seed(1000)
N <- 100
y <- rf(N, df1 = 2, df2 = 3)
plot(y)
Output:
Share your thoughts in the comments
Add Your Comment
Please Login to comment...