Where C:/Model/Var6.Dat Is the Data File Name

Total Page:16

File Type:pdf, Size:1020Kb

Where C:/Model/Var6.Dat Is the Data File Name

Instructions:

1. Copy the whole program from markov.txt file and paste it on the S-plus command prompt(>).

2. Submit the following instruction to invoke the markov function

>mar.gen("c:/model/var6.dat",6,1,1,12)

where “c:/model/var6.dat” is the data file name

6 is the number of column (variables) in the data file.

1 order of the MC (2,3…or 2nd, 3rd…order)

1 logistic link function (always should be 1, though we have option 2 for another one)

12 maximum number of iteration (can be change)

I am attaching the S-plus program file (markov.txt), a sample data file (var6.dat). Two other PDF files contains for theory and program paper.

Considerations for the data file. In data file first column should be id, 2nd column should be follow-up number. Third column is outcome variable should be coded as 0 and 1. Columns from fourth onwards are covariates. First row in the data file is variable names. It is an ASCII free format tab delimited data file. Can be created easily by SPSS, SAS or any other program. While preparing data file it should be sorted on the basis of first two columns (i.e. ID and Follow-up number). Program will not handle missing value. So missing values should be removed from the data file.

Suggested Readings

1. Islam MA, Chowdhury RI. A Higher Order Markov Model for Analyzing Covariate Dependence. Applied Mathematical Modelling 2006, 30(6), 477-488. 2. Islam MA, Chowdhury RI. 2008. Chapter 4: First and Higher Order Transition Models with Covariate Dependence. ed., F. Columbus, Nova Science Publishers, Hauppage, NY, pp. 153-196. 3. Islam MA, Chowdhury RI, Shahariar Huda. Markov Models with Covaraite Dependence for Repeated Measures. Nova Science, New York, 2009. https://www.novapublishers.com/catalog/product_info.php?products_id=7818 In Table 1 first set is for the transition type 0->1 and second set is for transition type 1- >0.

Following table showed the estimates of first order Markov model from (var6.dat) file.

Table 1. First Order

[1] "Transition Matrix" 0 1 [1,] 0 : 472 71 [2,] 1 : 73 274 Order Iteration 1 1 5 [1] "======" Var.name Co.effi Std.err t.value p.value 1 Const. -1.52436825 0.2666139 -5.7175128 1.080946e-008 2 ECO1 -0.15083537 0.3120538 -0.4833634 6.288377e-001 3 V50 -0.63607275 0.2653584 -2.3970329 1.652844e-002 4 AGEM1 0.17824587 0.2583070 0.6900544 4.901600e-001 5 Const. -1.63478801 0.2657913 -6.1506449 7.716854e-010 6 ECO1 -0.12406914 0.3346426 -0.3707512 7.108228e-001 7 V50 0.08751312 0.2748148 0.3184440 7.501482e-001 8 AGEM1 0.64450751 0.2667301 2.4163280 1.567793e-002 [1] "======" Chi.square Value D.F. P.value 1 U(B0)'*inv(I(B0))*U(B0) = 419.900955019578 8 0 2 U(B)'*inv(I(B))*U(B) = 9.08859313317171e-010 8 1 3 (BH-B0)'*I(BH))*(BH-B0) = 317.585060127393 8 0 4 (BH-B0)'*I(B0))*(BH-B0) = 687.103347272703 8 0 5 Sum (Zi-square) = 83.0534706574975 8 1.18793863634892e-014 6 Likelihood Ratio Test = 468.349265367628 8 0 7 AIC = 781.452716029061 0 - 8 BIC = 810.210407065876 0 - 9 BILLINGSLEY = 4.9688493040574e-010 1 0.999982214422381 [1] "Matrix has converged" > Following table showed the estimates of second order markov model from (var6.dat) file. In Table 2 first set is for the transition type 001 and second set is for transition type 101. Third set is 010 and the fourth set is for 110.

>mar.gen("c:/model/var6.dat",6,2,1,12)

Table 2 Second Order

[1] "Transition Matrix" 0 1 [1,] 0 0 : 286 37 [2,] 1 0 : 41 18 [3,] 0 1 : 22 30 [4,] 1 1 : 27 160 Order Iteration 1 2 5 [1] "======" Var.name Co.effi Std.err t.value p.value 1 Const. -1.80770266 0.3745626 -4.82616954 1.391840e-006 2 ECO1 0.04495888 0.4108433 0.10943072 9.128609e-001 3 V50 -0.64609320 0.3673572 -1.75875999 7.861828e-002 4 AGEM1 0.36295193 0.3574739 1.01532439 3.099512e-001 5 Const. -0.03995150 0.5985404 -0.06674821 9.467822e-001 6 ECO1 -1.20175596 0.8562562 -1.40350043 1.604677e-001 7 V50 -0.97962995 0.6146598 -1.59377577 1.109863e-001 8 AGEM1 -0.04942729 0.6128368 -0.08065328 9.357177e-001 9 Const. -1.35983774 0.7345857 -1.85116277 6.414614e-002 10 ECO1 0.74714778 0.8438215 0.88543348 3.759229e-001 11 V50 -0.37052940 0.6531448 -0.56730058 5.705100e-001 12 AGEM1 1.99123328 0.6776542 2.93842085 3.298889e-003 13 Const. -2.31117123 0.4390681 -5.26381055 1.410998e-007 14 ECO1 -0.43136716 0.5804829 -0.74311782 4.574104e-001 15 V50 0.55320259 0.4538697 1.21885765 2.228982e-001 16 AGEM1 0.57592417 0.4215880 1.36608301 1.719129e-001 [1] "======" Chi.square Value D.F. P.value 1 U(B0)'*inv(I(B0))*U(B0) = 314.941387397259 16 0 2 U(B)'*inv(I(B))*U(B) = 1.84556287463392e-008 16 1 3 (BH-B0)'*I(BH))*(BH-B0) = 224.124279402895 16 0 4 (BH-B0)'*I(B0))*(BH-B0) = 566.372757796617 16 0 5 Sum (Zi-square) = 76.7275681978871 16 6.43377684461655e-010 6 Likelihood Ratio Test = 357.749165144893 16 0 7 AIC = 535.139633110561 0 - 8 BIC = 592.65501518419 0 - 9 BILLINGSLEY = 8.21493232445299e-009 3 0.999999999999802 [1] "Matrix has converged" >

Recommended publications