Perform Probability Density Analysis on t-Distribution in R Programming – dt() Function

dt() function in R Language is used to return the probability density analysis on the Student t-distribution with random variable x and degree of freedom df.

Syntax: dt(x, df)

Parameters:
x: Random Variable
df: Degree of Freedom

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R Program to perform
# Probability Density Analysis
  
# Calling dt() Function
dt(0, 10)
dt(1, 15)
dt(3, 40)

chevron_right


Output:

[1] 0.3891084
[1] 0.2341248
[1] 0.006185947

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R Program to perform
# Probability Density Analysis
  
# Creating a vector
x <- seq(1, 10, by = 1)
  
# Calling dt() Function
y <- dt(x, 2)
  
# Plotting probability distribution graph
plot(x, y, type ="l")

chevron_right


Output:
PDA-graph

My Personal Notes arrow_drop_up

Recommended Posts:


Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.