Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Compute the Logistic Density in R Programming – dlogis() Function

  • Last Updated : 25 Jun, 2020

dlogis() function in R Language is used to compute logistic density of the distribution. It also creates a plot of the density of the logistic distribution.

Syntax: dlogis(vec)

Parameters:
vec: Vector of x-values for density

Example 1:




# R program to calculate 
# logistic density
  
# Create a vector of x-values
x <- seq(-1, 1, by = 0.1)
  
# Calling the dlogis() function
y <- dlogis(x)
y

Output:

 [1] 0.1966119 0.2055003 0.2139097 0.2217129 0.2287842 0.2350037 0.2402607
 [8] 0.2444583 0.2475166 0.2493760 0.2500000 0.2493760 0.2475166 0.2444583
[15] 0.2402607 0.2350037 0.2287842 0.2217129 0.2139097 0.2055003 0.1966119

Example 2:




# R program to calculate 
# logistic density
  
# Create a vector of x-values
x <- seq(-1, 1, by = 0.01)
  
# Calling the dlogis() function
y <- dlogis(x)
  
# Plot the graph
plot(y)

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!