ashokkrish / CougarStats

5 stars 2 forks source link

Probability Distributions: Negative binomial distribution #7

Closed ashokkrish closed 1 week ago

ashokkrish commented 6 months ago

@bryce-carson

Under Probability Distributions we currently have

image

To this list add Negative Binomial and make inline = FALSE so the radio buttons are listed vertically.

Have the following numericInputs()

Number of successes (r) (Validation: Non-empty, Positive integers only, must be greater than 0) Probability of Success (p) (Validation: Non-empty, between 0 and 1 only, inclusive)

Followed by

image

Followed by a radio button toggle

Selecting either one of the radio buttons would reveal a numericInput labelled

Number of Successes (x) (Validation: Non-empty, Positive integers only)

If the user selects

image

reveal two numericInputs labelled

Number of Successes (x1) (Validation: Non-empty, Positive integers only) Number of Successes (x2) (Validation: Non-empty, Positive integers only)

Further validate that x1 is less than or equal to x2.

Finally we will have

image
ashokkrish commented 5 months ago

Thank you for working on this @mwals360 . I have couple of minor changes on this one

image

Change rth to r^th (italicize r and take the th as a superscript) for both radioButton items.

ashokkrish commented 5 months ago

@bryce-carson Here is an example with solutions, you can use these as defaults instead of 12345.

image image image image
ashokkrish commented 1 month ago

@bryce-carson

For Negative Binomial Distribution validate the following numericInputs()

Number of successes (r) (Validation: Non-empty, Positive integers only, must be greater than 0) Probability of Success (p) (Validation: Non-empty, between 0 and 1 only, inclusive)

Number of Successes (x) (Validation: Non-empty, Positive integers only) - THIS HEADER IS INCORRECT

Where appropriate also validate

Number of Successes (x1) (Validation: Non-empty, Positive integers only) - THIS HEADER IS INCORRECT Number of Successes (x2) (Validation: Non-empty, Positive integers only) - THIS HEADER IS INCORRECT

Further validate that x1 is less than or equal to x2.

If any of the numericInputs is left blank we need to see this instantly

image

If the user enters a negative value for r

image

If the user enters a decimal value for r

image

If the user enters an invalid value for p

image image

If the user enters an invalid value for x, x1, or x2

image

In addition if the user clicks the Calculate button the display appropriate messages (bolded and in red on the mainPanel()). For e.g.

Number of Successes (r) must be a positive integer

Probability of Success (p) must be between 0 and 1