Description Usage Arguments Details Value Examples
This utility function calcuates the distance between the implied distribution of outcomes for a specific value of X and a specific variable, and the observed distribution of outcomes from the original data. The distance function being used is the sum of squared differences.
1 | squared.error(X, variable)
|
X |
A real number. This is the number that is picking out one member of the family of probability functions that are consistent with the fitted logisitic model. |
variable |
A column name from the original data frame. This will be the variable one of whose values you are calculating the probability for. |
The real-valued X indexes a family of probability distributions for a given
explanatory variable. By specifying a variable, the function
implied.proportion
can produce implied probabilities, and these are
compared with the observed distribution for each outcome.
The purpose of this function is to have a function of X that we can seek to
minimise. This is precisely what the recommend
function does.
The sum of the squared differences between the observed distribution of outcomes and the distribution of outcomes implied by your choice of X and variable of interest.
1 | squared.error(-1.9,"gender")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.