draw.geom: Draws a Geometric distribution

View source: R/draw.R

draw.geomR Documentation

Draws a Geometric distribution

Description

By providing X and a probability, you can draw either CDF or PMF

Usage

draw.geom(
  X,
  p,
  cumulative = F,
  decreasing = F,
  round = 3,
  show.label = TRUE,
  nudge = 0
)

Arguments

X

Mishtane Mikri. Can be a vector of values. each X is k successes.

cumulative

a logical. If TRUE: draws a CDF. default is set to FALSE.

decreasing

a logical. Concerns the data frame returned, if TRUE: decreasing order of probabilities, Otherwise same order as input of X. default is set to FALSE.

round

How many decimals to show. Default is set to 3.

show.label

A logical. Default (TRUE) prints probability labels on the plot.

nudge

When show.label is TRUE, you can adjust the location of the labels by inputing a 2 length vector to adjust the label position (a single values works too). Usualy no adjustment is needed.

P

Probability for success in each trial.

Value

graph (Print only).

Tohelet and Shonut (Print only).

data.frame of X and their probs (use decreasing to change order method, in case random numbers are assigned).

Note

Very important: Unlike usual input in dgeom, please refer to 1 as success in 1st attempt.

See Also

For a fully detailed explanation about the differences between distributions please visit https://www.researchgate.net/post/What-is-the-difference-between-probability-distribution-function-and-probability-density-function

Examples

x <- c(1:5)
draw.geom(x,p=0.3)
draw.geom(x,p=0.3,cumulative=TRUE)

bgupsych/bgupsych documentation built on Nov. 1, 2023, 9:41 a.m.