defaultAlphas: Generates default values for Alpha and Beta parameters

defaultAlphasR Documentation

Generates default values for Alpha and Beta parameters

Description

The expected shape of the Alpha and Beta parameters depends on the type of rule. If isOffsetRule(rule) is true, then the betas should be a vector of the same length as pnames and alphas should be a scalar. If it is false, then alphas is the vector and betas is the scalar.

Usage

defaultAlphas(rule, pnames, states=c("Yes","No"), 
             link="partialCredit")
defaultBetas(rule, pnames, states=c("Yes","No"), 
             link="partialCredit")

Arguments

rule

A rule (e.g., Compensatory, OffsetConjunctive or the name of a rule.

pnames

A character vector giving the names of the parent variables.

states

A character vector giving the names of the states of the child variable.

link

A link function (e.g., partialCredit) or the name of a link function.

Details

Rules come in two styles:

Linear rules, e.g., Compensatory

These take multiple slopes (alphas) and a single intercept (beta).

Offset rules, e.g., OffsetConjunctive

These take multiple intercepts (betas) and a single slope (alpha).

The value of getOffsetRules() determines which rules use which style. These functions are useful for getting the shape right when the parameters have not yet been established.

There may or may not be different values for alpha or beta for each state transition depending on the link function. If multiples are allowed then a list of alphas or betas is returned, corresponding to the _transitions_ between the states (so the length of the list is one less than the length of states).

The shape of the result is as follows:

partialCredit

With this link function both alphas and betas will be lists if the number of states is greater than 2.

gradedResponse

With this link function, the betas are a list and the alphas are a single vector. Note that the betas should be in increasing order, but this is not enforced.

normalLink

Both alphas and betas are vectors.

Value

Either a named vector (the names are pnames) of the default value (1 for alphas, 0 for betas) or scalar value, or a named list of such. If a list, then the names follow the names of the states with the last one omitted.

Note

As more link functions are added, this needs to be expanded.

Author(s)

Russell Almond

See Also

calcDPCTable, getOffsetRules, partialCredit, gradedResponse, normalLink

Examples


  defaultAlphas("Compensatory",c("S1","S2"),c("Yes","No"))
  defaultBetas("Compensatory",c("S1","S2"),c("Yes","No"))

  defaultAlphas("Compensatory",c("S1","S2"),c("Yes","Maybe","No"))
  defaultBetas("Compensatory",c("S1","S2"),c("Yes","Maybe","No"))

  defaultAlphas("Compensatory",c("S1","S2"),c("Yes","Maybe","No"),
                "gradedResponse")
  defaultBetas("Compensatory",c("S1","S2"),c("Yes","Maybe","No"),
               "gradedResponse")
  
  defaultAlphas("Compensatory",c("S1","S2"),c("Yes","Maybe","No"),
                "normalLink")
  defaultBetas("Compensatory",c("S1","S2"),c("Yes","Maybe","No"),
               "normalLink")

  defaultAlphas("OffsetConjunctive",c("S1","S2"),c("Yes","No"))
  defaultBetas("OffsetConjunctive",c("S1","S2"),c("Yes","No"))
  
  defaultAlphas("OffsetConjunctive",c("S1","S2"),
                c("Yes","Maybe","No"),"gradedResponse")
  defaultBetas("OffsetConjunctive",c("S1","S2"),
                  c("Yes","Maybe","No"),"gradedResponse")

ralmond/CPTtools documentation built on Dec. 27, 2024, 7:15 a.m.