MLM_Exact_Design: Approximation to exact design algorithm for multinomial logit...

View source: R/MLM_Exact_Design.R

MLM_Exact_DesignR Documentation

Approximation to exact design algorithm for multinomial logit model

Description

Approximation to exact design algorithm for multinomial logit model

Usage

MLM_Exact_Design(
  J,
  k.continuous,
  design_x,
  design_p,
  det.design,
  p,
  ForLion,
  bvec,
  bvec_matrix,
  rel.diff,
  L,
  N,
  hfunc,
  link
)

Arguments

J

number of response levels in the multinomial logit model

k.continuous

number of continuous factors

design_x

the matrix with rows indicating design point which we got from the approximate design

design_p

D-optimal approximate allocation

det.design

the determinant of D-optimal approximate allocation

p

number of parameters

ForLion

TRUE or FALSE, TRUE: this approximate design was generated by ForLion algorithm, FALSE: this approximate was generated by EW ForLion algorithm

bvec

If ForLion==TRUE assumed parameter values of model parameters beta, same length of h(y)

bvec_matrix

If ForLion==FALSE the matrix of the bootstrap parameter values of beta

rel.diff

points with distance less than that will be merged

L

rounding factor

N

total number of observations

hfunc

function for obtaining model matrix h(y) for given design point y, y has to follow the same order as n.factor

link

link function, default "continuation", other choices "baseline", "cumulative", and "adjacent"

Value

x.design matrix with rows indicating design point

ni.design EW D-optimal or D-optimal exact allocation

rel.efficiency relative efficiency of the Exact and Approximate Designs

Examples

J=3
k.continuous=1
design_x<-c(0.0000,103.5451,149.2355)
design_p<-c(0.2027, 0.3981, 0.3992)
det.design=54016609
p=5
theta = c(-1.935, -0.02642, 0.0003174, -9.159, 0.06386)
hfunc.temp = function(y){
   matrix(data=c(1,y,y*y,0,0,0,0,0,1,y,0,0,0,0,0), nrow=3,
            ncol=5, byrow=TRUE)
}
link.temp = "continuation"
MLM_Exact_Design(J=J, k.continuous=k.continuous,design_x=design_x,
design_p=design_p,det.design=det.design,p=p,ForLion=TRUE,bvec=theta,
rel.diff=1,L=0.5,N=1000,hfunc=hfunc.temp,link=link.temp)

ForLion documentation built on April 11, 2025, 5:38 p.m.