lab:projects:02robust_growth_curve_modeling_using_student-t_distribution:alternative_specification_using_auxiliary_variables
#WinBUGS codes generated by BAUW: http://bauw.psychstat.org #USE WITH CAUTION! Model{ # Model specification for linear growth curve model for (i in 1:N){ LS[i,1:2]~dmnorm(muLS[i,1:2], Inv_cov[1:2,1:2]) muLS[i,1]<-bL[1] muLS[i,2]<-bS[1] Inv_Sig_e2k[i]<-Inv_Sig_e2*w[i] for (t in 1:5){ y[i, t] ~ dnorm(muY[i,t], Inv_Sig_e2k[i]) muY[i,t]<-LS[i,1]+LS[i,2]*t } w[i]~dgamma(k2, k2) } k2<-k/2 k<-1/m m~dunif(0,.5) #Priors for model parameter for (i in 1:1){ bL[i] ~ dnorm(0, 1.0E-6) bS[i] ~ dnorm(0, 1.0E-6) } Inv_cov[1:2,1:2]~dwish(R[1:2,1:2], 2) R[1,1]<-1 R[2,2]<-1 R[2,1]<-R[1,2] R[1,2]<-0 Inv_Sig_e2 ~ dgamma(.001, .001) Sig_e2 <- 1/Inv_Sig_e2 Cov[1:2,1:2]<-inverse(Inv_cov[1:2,1:2]) Sig_L2 <- Cov[1,1] Sig_S2 <- Cov[2,2] Cov_LS <- Cov[1,2] rho_LS <- Cov[1,2]/sqrt(Cov[1,1]*Cov[2,2]) } # The (naive) starting values for model parameters. list(m=.1, bL=c(5), bS = c(2), Inv_Sig_e2 = 1, Inv_cov= structure(.Data = c(1,0,0,1),.Dim=c(2,2)),LS = structure(.Data = c( 4.566,1.296,5.097,1.591,5.169, 0.2067,4.221,1.752,7.714,0.05158, 4.08,0.8305,6.492,2.576,2.957, 2.289,4.33,2.634,5.698,0.9366, 3.032,2.831,3.752,3.166,4.13, 2.936,4.758,3.296,5.104,1.947, 5.585,0.3074,2.933,1.625,3.385, 2.499,4.996,1.862,4.851,3.503, 4.011,3.282,3.771,1.866,7.545, 0.7209,4.677,3.086,4.66,1.711, 5.522,0.8198,5.294,2.812,4.001, 0.9769,5.26,2.406,5.248,1.716, 4.763,1.472,3.802,1.811,5.598, 1.175,3.664,3.627,5.227,1.966, 4.348,2.246,5.761,1.038,4.725, 0.9613,7.291,1.845,4.503,1.986, 5.549,1.017,4.482,3.032,4.835, 2.42,4.757,1.839,3.154,3.117, 5.096,3.68,6.292,1.698,4.133, 2.911,6.694,1.267,2.638,2.96, 5.153,2.161,4.265,1.439,6.239, 0.5326,4.424,3.33,8.357,1.119, 5.076,3.825,3.696,3.836,6.229, 2.629,4.735,1.436,4.355,4.295, 4.083,0.587,4.017,2.176,3.932, 2.548,5.382,3.254,7.278,-1.7, 5.075,2.704,3.276,2.462,3.789, 2.759,4.188,1.682,5.856,-0.02246, 5.626,2.911,5.25,0.6643,3.518, 0.6248,5.568,-0.3362,5.113,1.026, 5.483,3.262,4.109,-0.224,5.263, 1.267,4.328,3.363,3.826,2.93, 5.072,3.007,5.006,0.1496,5.6, 3.097,3.43,2.453,3.853,1.895, 5.529,5.122,4.729,0.5532,5.483, 1.195,5.297,2.667,7.458,-0.3812, 4.517,3.327,6.143,1.963,4.166, 1.747,6.654,1.149,5.48,2.751, 4.676,3.682,4.741,0.9135,6.634, 0.9691,3.015,3.719,5.544,0.3026, 8.473,-0.05376,5.445,0.3776,5.872, 2.752,5.374,1.754,4.358,1.564, 3.614,1.932,3.819,2.293,5.234, 2.287,5.715,0.8591,4.266,1.628, 4.407,1.63,6.875,1.901,6.601, 1.814,5.26,3.401,6.045,1.512, 6.384,1.931,4.397,2.575,5.621, 2.068,3.955,2.035,3.963,4.335, 3.606,2.753,5.423,3.229,3.365, 3.694,3.162,2.068,3.245,1.526, 5.707,2.17,6.89,1.269,6.366, 1.796,5.205,2.657,2.983,2.237, 3.839,1.395,4.987,1.982,3.602, 1.472,6.281,1.734,5.184,0.6604, 5.378,0.5802,4.991,0.9695,5.066, 1.348,5.603,2.043,5.809,2.801, 5.842,2.676,3.675,3.962,3.662, 3.824,5.224,0.6743,4.469,2.333, 6.069,0.7096,4.616,-0.3334,5.343, 2.654,6.237,0.7163,4.499,2.653, 5.281,1.838,5.133,0.2718,4.094, 2.853,5.302,1.162,6.507,2.464, 5.323,2.076,5.524,1.388,4.234, 1.791,5.422,1.293,4.803,1.833, 5.437,2.918,6.329,1.807,3.844, 2.078,4.942,1.421,4.532,2.335, 4.09,3.212,4.584,1.893,4.075, 2.785,4.994,2.086,7.62,0.5028, 6.183,1.687,4.81,1.701,4.524, 2.823,4.52,1.151,4.888,2.011, 5.29,0.6222,3.902,3.948,4.576, 3.595,3.173,1.963,6.568,1.8, 4.766,4.369,5.271,2.561,2.708, 3.804,3.051,3.742,5.848,3.619, 4.575,2.68,4.086,2.482,4.773, 1.855,4.998,0.3159,5.192,1.249, 4.623,2.551,5.218,1.702,5.596, 1.383,8.594,-0.873,3.893,3.145, 5.6,2.44,2.998,2.888,4.313, 2.296,5.155,0.7865,5.493,1.181, 2.937,3.038,4.175,2.596,5.03, 0.1572,3.831,2.44,4.101,4.121, 3.439,3.192,3.721,1.967,5.265, 1.435,7.236,-0.2765,4.912,2.113, 2.975,4.473,4.462,3.098,6.984, 1.585,4.883,3.923,6.182,2.541, 5.125,4.306,5.548,1.39,3.717, 2.873,4.944,1.392,5.838,1.452, 4.414,1.325,4.637,1.496,6.23, 1.862,7.584,2.173,4.429,1.053, 3.849,4.382,6.643,1.903,5.058, 1.959,5.117,1.555,2.459,2.857, 5.061,4.801,3.284,2.263,6.385, 0.6228,5.92,1.156,3.589,2.291, 4.59,0.9942,4.94,2.276,4.362, 2.559,4.001,1.483,5.137,2.422, 6.083,1.122,4.837,0.7332,3.471, 2.692,3.333,1.38,5.112,3.04, 4.956,3.464,3.974,0.3202,5.573, 0.663,5.527,1.23,7.411,-0.7974, 5.998,2.797,6.369,1.766,4.378, 0.8029,3.94,3.282,2.703,2.085, 4.728,2.277,6.481,0.5644,4.386, 1.66,4.666,2.983,5.682,-0.1715, 3.265,3.664,3.934,3.127,5.824, 1.332,4.981,1.84,4.306,2.155, 4.282,1.269,6.326,3.538,4.848, 2.82,4.157,3.037,7.543,1.356, 5.415,1.109,3.575,2.992,6.756, 1.863,3.931,3.358,2.441,3.141, 3.26,1.156,5.415,0.1014,5.434, 4.087,4.757,0.9659,5.034,1.92, 5.907,1.306,3.807,2.066,4.787, 2.371,5.426,2.611,5.231,2.609, 4.228,1.401,5.619,0.6223,4.014, 1.677,4.832,2.845,4.735,3.127, 3.778,3.568,6.182,-0.02521,2.452, 4.343,5.177,2.523,3.454,2.347, 6.209,2.281,3.053,2.934,5.425, 2.055,3.311,4.488,4.457,3.744), .Dim = c(300,2))) # Please put your data here. Remeber you can convert your data by BAUW--Convert Data. :) list(N=300, y = structure(.Data = c( 5.434,6.667,9.555,9.774,8.141, 6.031,9.47,8.635,12.03,13.33, 4.388,5.667,6.048,7.182,5.825, 7.696,7.657,7.235,13.66,13.95, 6.763,6.758,9.775,9.979,9.139, 5.388,7.156,6.545,7.241,7.986, 9.913,12.75,13.99,17.48,15.57, 4.457,8.631,9.998,12.95,15.71, 10.78,9.27,10.28,18.82,17.15, 5.851,7.179,9.009,9.739,10.41, 7.267,9.782,11.46,16.16,17.98, 7.062,10.26,13.08,15.88,19.96, 5.28,10.33,12.66,15.06,18.82, 8.238,10.49,15.67,13.88,21.3, 8.211,8.457,9.681,12.83,14.86, 7.032,5.918,6.141,5.725,7.737, 4.502,4.673,6.797,9.571,11.42, 5.346,6.334,10.96,11.18,13.32, 7.327,9.246,8.09,11.0,13.72, 8.312,11.22,14.16,21.47,21.87, 7.561,8.409,16.16,19.37,20.62, 6.398,7.642,9.167,11.01,12.26, 8.197,7.792,9.609,9.222,13.0, 6.475,10.13,14.86,17.08,20.62, 6.518,13.3,10.87,12.87,12.74, 4.8,4.236,7.493,8.459,8.67, 8.294,10.87,14.88,15.09,18.64, 4.955,6.128,8.075,7.82,8.608, 8.83,12.34,13.19,16.03,18.8, 10.04,9.023,9.447,12.78,14.41, -24.34,5.734,8.996,12.1,12.09, 5.237,7.455,8.778,10.16,13.19, 6.836,10.12,9.678,11.0,10.07, 6.129,12.67,14.28,17.8,21.36, 6.873,8.877,10.08,14.91,15.32, 6.897,8.645,8.155,11.67,16.04, 5.242,7.948,9.34,6.176,10.17, 5.867,5.296,7.69,8.587,11.1, 10.32,11.15,12.86,14.5,15.71, 6.092,7.549,10.65,10.15,14.42, 6.437,9.938,8.223,10.25,12.8, 8.851,10.88,14.62,15.65,19.21, 5.78,10.9,11.17,17.78,17.1, 7.626,11.15,10.92,12.74,17.14, 5.077,10.14,8.602,18.68,18.6, 10.28,12.74,16.09,21.09,21.87, 8.132,11.75,11.93,10.52,15.0, 4.784,9.41,10.95,14.35,19.41, 5.098,10.41,11.77,11.07,11.23, 3.681,6.731,12.31,15.98,16.5, 4.656,8.072,12.01,13.01,16.22, 5.526,7.743,10.1,9.762,11.08, 8.501,8.554,9.194,7.784,10.77, 8.816,11.4,16.14,18.19,23.55, 5.883,9.943,10.81,11.47,12.73, 9.612,10.21,16.01,20.61,23.51, 9.509,10.77,15.08,17.02,22.13, 9.213,10.69,14.47,18.04,19.01, 5.157,7.923,7.131,9.302,12.41, 9.781,12.61,15.93,20.92,25.0, 4.803,5.907,6.863,5.865,6.197, 7.346,10.09,10.4,14.55,15.09, 6.725,10.25,12.0,13.91,14.71, 10.44,10.65,13.8,19.52,22.26, 5.968,3.309,1.568,0.2516,0.1415, 4.673,10.31,14.23,15.65,16.5, 6.411,8.871,10.33,13.7,16.38, 6.634,9.475,13.84,14.62,17.73, 5.316,8.731,9.563,10.23,11.96, 4.682,3.747,3.121,5.813,5.657, 8.405,10.61,14.22,15.12,19.34, 5.413,3.841,5.177,7.947,8.173, 4.855,4.056,4.441,5.631,9.194, 3.873,7.993,5.764,4.727,1.546, 5.951,7.452,8.943,8.472,10.3, 9.364,13.85,14.13,17.16,21.13, 3.568,5.008,4.208,2.201,2.549, 2.506,8.606,9.179,10.47,10.94, 6.344,8.923,16.07,17.2,23.8, 7.278,10.83,12.02,14.46,19.86, 10.23,9.773,15.0,17.81,18.78, 4.633,6.487,5.389,6.911,3.369, 8.313,11.64,14.52,17.68,21.59, 6.772,4.514,11.26,13.64,14.54, 5.864,6.61,7.421,11.08,12.04, 11.97,16.87,23.24,25.97,30.85, -0.5038,4.44,4.22,6.721,7.38, 6.895,8.83,9.489,9.843,13.0, 6.465,10.77,11.66,14.46,18.55, 6.786,5.029,6.812,6.548,5.732, 5.149,10.8,16.43,18.8,21.16, 11.16,10.13,12.67,14.52,16.22, 5.936,7.817,8.495,11.34,13.41, 7.996,7.868,8.386,9.717,12.55, 8.164,10.55,10.91,16.22,19.63, 7.101,12.95,15.79,19.48,23.44, 5.681,5.933,5.652,8.134,9.741, 9.843,8.478,10.4,9.713,12.11, 7.08,12.07,13.46,16.58,20.57, 4.86,5.75,6.042,7.756,7.575, 7.606,7.478,9.364,7.974,8.443, 5.821,4.091,6.345,5.65,6.517, 9.533,15.47,14.35,17.7,19.74, 7.027,9.603,10.15,13.86,15.88, 5.381,7.223,7.76,10.78,10.56, 7.076,7.102,10.03,11.96,13.96, 2.82,8.425,10.58,12.48,16.25, 7.635,10.25,12.55,15.47,18.3, 6.139,7.936,8.559,10.13,11.75, 5.944,7.622,7.68,12.14,11.6, 6.227,8.782,6.851,11.54,11.28, 7.478,10.48,14.38,14.15,17.43, 7.579,9.177,12.32,15.73,16.2, 8.949,12.31,15.46,19.42,22.36, 7.438,9.246,11.24,12.1,15.6, 6.016,9.548,12.03,14.71,15.81, 5.553,8.987,12.16,15.23,16.85, 5.745,9.478,11.86,13.47,15.23, 2.34,6.687,9.96,10.91,11.8, 9.228,12.75,16.27,21.87,25.32, 7.269,9.609,12.39,14.01,15.96, 7.854,11.73,14.32,15.9,19.84, 9.874,9.001,15.56,16.94,24.02, 4.125,6.003,8.816,12.77,13.34, 5.34,7.042,5.239,10.05,10.52, 8.706,8.111,11.41,12.81,17.63, 7.381,9.335,11.17,13.08,13.41, 8.069,10.97,11.04,13.64,18.91, 6.873,8.726,14.4,16.95,16.84, 1.507,8.334,10.86,11.39,12.86, 3.916,6.754,-4.17,10.71,8.455, 8.119,7.972,11.12,11.56,16.59, 6.8,5.647,8.667,9.273,12.48, 7.471,8.88,12.64,14.1,14.83, 5.876,9.407,6.248,8.864,7.71, 2.832,6.472,9.658,7.678,8.599, 5.55,7.267,5.662,6.33,9.457, 7.009,7.084,5.089,10.99,12.44, 7.434,11.18,12.83,14.06,14.32, 9.934,11.44,13.04,17.48,20.45, 8.497,10.06,14.94,16.2,19.88, 7.185,11.53,17.84,20.28,23.17, 5.919,12.17,16.17,16.21,22.54, 2.448,6.455,10.18,8.362,9.384, 6.235,8.462,10.79,12.18,16.95, 6.352,8.181,9.213,8.034,10.25, 2.528,3.022,5.37,3.118,2.576, 8.712,10.74,14.13,16.2,17.79, 6.809,8.895,10.3,9.686,8.94, 6.772,11.86,13.09,12.84,17.77, 7.698,6.951,9.389,11.73,12.73, 5.356,5.389,6.481,6.061,5.376, 6.781,11.51,13.48,17.17,19.35, 6.555,7.473,8.024,10.53,11.92, 10.99,11.04,14.81,16.94,21.18, 5.117,11.69,10.0,14.13,19.68, 8.911,9.806,9.551,10.05,12.9, 5.736,9.307,10.54,14.28,12.85, 8.198,9.182,9.134,11.14,11.58, 6.646,8.469,10.06,11.14,14.05, 7.1,11.33,14.35,17.35,19.08, 6.422,8.741,11.81,13.36,13.83, 4.895,8.199,9.752,11.63,14.05, 7.992,8.197,9.102,11.31,13.81, 6.947,10.99,14.49,12.22,13.84, 7.657,11.41,15.33,17.01,20.3, 7.358,8.334,10.49,10.9,15.71, 6.263,8.972,12.22,16.55,19.1, 6.096,10.49,12.11,10.3,16.28, 7.869,6.923,8.674,8.931,10.41, 8.518,8.2,10.23,16.18,13.47, 4.797,7.408,8.641,11.4,11.84, 8.714,9.693,12.21,15.25,20.65, 5.422,5.882,7.475,12.47,10.4, 7.396,9.947,11.17,13.76,13.46, 5.534,6.94,7.093,8.603,9.94, 9.473,9.452,16.18,19.46,22.55, 7.274,12.06,15.95,18.4,24.71, 5.006,8.394,8.229,11.01,13.45, 8.301,9.131,13.06,13.05,14.92, 6.933,13.12,15.4,22.77,27.63, 7.733,10.95,14.95,16.71,17.51, 4.47,10.03,13.38,18.11,22.31, 7.032,9.203,15.19,16.56,24.07, 10.76,14.43,19.01,19.14,24.53, 9.229,10.17,14.37,13.85,19.83, 5.513,4.403,14.26,15.59,16.8, 7.328,11.57,11.69,11.57,13.53, 5.106,6.43,5.393,6.543,4.928, 6.95,7.191,11.69,10.59,10.55, 3.387,9.406,11.83,14.42,17.95, 5.401,8.521,7.748,12.3,13.83, 6.988,7.986,8.281,10.35,10.6, 6.593,7.007,7.834,6.37,1.273, 7.387,7.677,11.48,17.18,18.62, 6.541,9.619,13.69,16.3,16.9, 3.309,6.234,12.53,15.27,17.6, 5.742,5.249,11.37,12.68,16.93, 6.748,7.126,7.033,7.74,10.33, 7.179,7.816,9.063,10.1,11.9, 6.404,10.95,10.41,13.13,16.84, 5.672,10.12,14.67,13.62,17.58, 4.771,6.432,6.369,5.669,7.253, 7.145,7.742,10.8,13.81,15.49, 8.415,13.01,16.21,20.89,25.69, 7.593,7.019,13.28,17.3,17.55, 6.861,9.019,8.923,12.65,14.2, 7.225,8.06,8.523,12.96,11.23, 5.838,5.307,3.137,5.966,5.733, 6.698,6.683,9.619,12.97,15.29, 8.003,9.819,16.31,20.78,26.22, 7.36,12.18,12.93,17.32,18.24, 8.476,11.13,13.83,15.22,14.67, 9.214,16.88,16.93,19.53,24.77, 7.873,10.17,13.86,17.95,18.31, 9.825,13.19,17.9,21.87,27.02, 6.503,8.272,10.38,11.32,12.3, 5.713,9.24,12.5,19.91,17.91, 5.669,8.369,10.28,9.336,11.01, 3.304,8.64,10.39,10.37,10.68, 6.711,8.024,10.46,10.57,10.36, 6.061,7.026,8.748,10.24,12.29, 9.735,7.702,13.02,14.52,14.68, 10.65,13.16,15.36,15.04,18.04, 4.662,6.66,6.267,6.982,9.401, 8.676,11.88,17.85,18.89,26.64, 6.097,9.547,10.87,13.3,15.76, 7.416,7.924,12.76,14.42,15.27, 7.699,8.195,8.15,12.82,12.43, 4.947,9.174,12.94,11.82,17.08, 10.11,14.72,21.19,24.82,30.36, 6.302,10.62,9.888,12.43,15.85, 8.102,14.87,8.236,8.541,9.303, 7.164,8.132,10.78,7.605,10.83, 4.26,6.816,13.92,12.01,11.7, 6.859,6.343,6.755,8.088,10.43, 4.805,9.792,15.83,15.22,15.48, 7.461,8.11,10.43,14.63,17.16, 4.439,6.938,8.087,10.56,11.83, 7.752,10.35,13.16,13.6,16.53, 7.643,8.692,6.851,11.25,12.38, 4.561,4.756,6.962,7.052,6.557, 5.119,8.035,10.99,13.78,14.84, 4.156,4.583,5.151,7.597,10.54, 8.037,11.46,15.22,17.49,24.09, 8.413,10.13,15.37,18.96,20.91, 10.42,6.146,2.242,6.541,7.009, 6.362,6.485,6.432,8.463,5.419, 7.497,8.186,11.13,11.84,11.11, 4.435,5.679,3.287,3.384,3.693, 6.438,11.33,14.83,18.87,21.76, 9.431,9.189,12.45,13.52,15.47, 4.991,7.784,6.671,7.192,8.837, 7.683,11.1,12.71,16.06,21.32, 5.288,8.055,10.34,11.47,13.86, 6.203,10.63,11.5,14.02,18.17, 6.897,7.86,7.677,9.414,7.718, 6.469,9.631,8.004,9.888,11.34, 6.438,10.21,13.33,17.89,18.96, 6.056,3.898,3.166,3.9,4.645, 7.503,9.75,14.11,17.82,19.17, 6.194,11.45,12.82,16.52,21.22, 6.879,9.928,10.37,11.0,12.54, 7.443,8.96,9.996,13.68,14.86, 6.192,8.718,8.559,12.6,14.62, 6.088,5.052,7.752,10.2,11.4, 8.152,14.4,18.46,19.96,22.65, 8.109,9.924,13.25,17.64,18.15, 7.536,12.1,12.87,14.86,19.17, 9.759,11.25,12.94,12.83,12.37, 7.341,8.644,9.471,10.69,10.78, 5.97,9.22,17.21,14.53,19.52, 8.119,11.73,11.69,14.67,15.29, 6.454,9.521,14.22,12.03,22.81, 5.253,9.432,13.26,15.8,17.29, 3.705,5.557,5.319,7.501,9.769, 7.096,5.311,5.793,5.8,5.531, 10.22,13.97,17.35,22.68,25.27, 6.687,7.265,7.91,9.513,10.88, 13.13,9.24,9.359,13.87,13.82, 5.972,7.768,12.21,11.02,11.9, 7.134,8.354,10.06,11.95,12.4, 6.82,6.696,14.41,13.21,16.61, 7.555,11.64,16.3,15.55,21.29, 9.202,7.785,12.23,13.55,17.08, 4.475,6.7,10.15,9.942,12.39, 5.155,5.567,5.345,8.752,10.74, 5.857,5.629,8.206,11.02,13.58, 7.167,11.53,15.18,15.47,18.14, 9.319,10.68,10.02,15.57,20.26, 8.728,11.06,13.76,19.58,21.99, 6.615,7.67,7.097,6.957,4.936, 7.253,10.58,16.1,19.4,24.19, 8.58,10.34,12.5,16.89,16.55, 5.01,9.503,8.964,12.74,15.53, 8.166,10.9,13.07,15.5,19.23, 5.981,8.438,15.96,14.03,15.88, 7.429,9.48,11.02,17.24,15.78, 4.993,12.18,18.07,22.74,24.87, 8.184,10.81,14.27,19.0,24.19), .Dim = c(300,5)))
lab/projects/02robust_growth_curve_modeling_using_student-t_distribution/alternative_specification_using_auxiliary_variables.txt · Last modified: 2016/01/24 09:48 by 127.0.0.1