bpformulas {bivpois} | R Documentation |
In the formula1 argument of functions lm.bp and lm.dibp the response should always be defined as y1y2. The syntax of formula1 is similar as all formula objects in R. The operators <+, :, *> are used as in normal formula objects to define additional main effects, interaction terms, or both. Three additional arguments/variables are defined internally in lm.bp and lm.dibp in order to help us build the model: noncommon, l1 and l2. *** Variable noncommon is used to specify which terms will be different for the linear predictors of lambda_1 and lambda_2. *** Variable l1 is used to specify which terms will have effect only on lambda_1 using a syntax of type +I(X*l1)' or +I(l1*X)'. *** Variable l2 is used to specify which terms will have effect only on lambda_2 using a syntax of type +I(X*l2)' or +I(l2*X)'.
The following combinations can be used
`+X:noncommon' or `+X*noncommon' |
The variable X has different effect on lambda_1 and lambda_2. |
`+X' |
When additional terms of the form `+X:noncommon' or `+X*noncommon' are not included in formula then the variable X has common effect on both lambda_1 and lambda_2. |
`+I(X*l1)' or `+I(l1*X)' |
The effect of variable X is estimated only for the linear predictor of lambda_1 (while for the linear predictor of lambda_2 is set equal to zero). |
`+I(X*l2)' or `+I(l2*X)' |
The effect of variable X is estimated only for the linear predictor of lambda_2 (while for the linear predictor of lambda_1 is set equal to zero). |
For the argument formula2 the response should always be defined as y3 while its syntax is the same as all formula objects in R. Some usual models are the followin 1. y1y2~1 : Common constant for lambda_1 and lambda_2 that is log(lambda_1i )= beta_0 and log(lambda_2i )= beta_0 . 2. y1y2~noncommon : Constant but not equal lambda_1 and lambda_2 that is log(lambda_1i )= beta_1,0 and log(lambda_2i )= beta_2,0 with beta_1,0?beta_2,0. 3. y1y2~. : Full model with different parameters for lambda_1 and lambda_2. Finally, in both lm.bp and lm.dibp we can construct models for which different variables have the same effect on lambda_1 and lambda_2. This can be achieved using terms of type c(z1,z2). Such as a term results to a common parameter for both lambda_1 and lambda_2 for the variable z1 and z2 respectively. ิhe formula y1y2 ~ noncommon + c(z1,z2)+z4:noncommon + z5 will result to the following model log(lambda_1) = beta_1,0 + beta_12 z1 + beta_1,4 z4 + beta_5 z5 log(lambda_2) = beta_2,0 + beta_12 z2 + beta_2,4 z4 + beta_5 z5
1. Dimitris Karlis, Department of Statistics, Athens University of Economics and Business, Athens, Greece, karlis@aueb.gr .
2. Ioannis Ntzoufras, Department of Statistics, Athens University of Economics and Business, Athens, Greece, ntzoufras@aueb.gr .
1. Karlis, D. and Ntzoufras, I. (2004). Bivariate Poisson and Diagonal Inflated Bivariate Poisson Regression Models in S. (submitted). Technical Report, Department of Statistics, Athens University of Economics and Business, Athens, Greece.
2. Karlis, D. and Ntzoufras, I. (2003). Analysis of Sports Data Using Bivariate Poisson Models. Journal of the Royal Statistical Society, D, (Statistician), 52, 381 393.
#ิhe formula # y1y2 ~ noncommon + c(z1,z2)+z4:noncommon + z5 #will result to the following model # log(lambda_1) = beta_1,0 + beta_12 z1 + beta_1,4 z4 + beta_5 z5 # log(lambda_2) = beta_2,0 + beta_12 z2 + beta_2,4 z4 + beta_5 z5 #see also examples 1 4: ex1.sim, ex2.sim, ex3.health, ex4.ita91 .