Agenda 1. More on multilevel R formulas 2. Generalized Multilevel Models 3. GMLM in R 1
More on multilevel R formulas 2
Building a two-level model <latexit sha1_base64="+Rpt2uKXCvMcGxWzJWs4kWPItZw=">AFrHichVRb9s2Fa9eWu9W7s+9oVYsCDFDEOXNoHA2m2Xh7SLJuTNoBlGDRzLBMiJYGk2mYE/9F+zd6G7cfsUI4TK2g6wgbO9TvfBx1yVgmuTRj+fafz2efdL768e6/31dfPvd/Qfv9FlrRicslKU6mxGNQhewKnhRsBZpYDKmYC3s/xn3/7DpTmZXFiLiqYSJoVfM4ZNRiaPug8H0tzx3ZTDWXhKSmoWS9qhU0m2lsm6yfUxmkj5O094qRDaHJ2BoVMbovfTyoly9yDKb+OxLl7AZKVjDJ3YGgLJ9yj4m/aygPnFEpvRs2yCsvciP+B0z9Vjsn+oPDKCbKbVghamlNa6oXuqihxJ0DZAtQlkfyT1dur6iXDTxfvuGNVleVKxXkqK2pKglKVqXtCq/7o3bvXGrN45uqroCidBkjZI0gJohtife52uUn8Ebk4YHp/IxEYbIX7xI0dneSPW/E29H2bkiQdicjX0SNOcYF+8oPS9ZLaEwTFCtx1FYmYmlynAmwPXSWkOFU2gGYzQLKkFPbLPwjvyIkXMyLxX+C0Oa6HqHpVLrCznDSr/P+mbOBz+a+7Ac0EvPY43qvGsvJiJGpz9/eWBs8lOf2e3v/fU9doUzfzJxPKiqg0UbMlwXgtiSuKvHTnCpgRF2hQpjiKJGxBFWUGL2eP4Fmn0RCrgDnMeCq0FsYrnQM1tQJtD3m2tIYncNYfMfz8w9fUsMVh+R4Uweh39z94SX35QNRlJeKTxL4C8Q6QCVH4EuWaRzs81u/8Iwb3T/Ed6Lov1QA+ePxUS1nSHeI4wteZH2/CqXyDwkVrjXwdnQlx/9TOAIzwm9XihfIwqMtCNr50t8FnCWfbX12fO8vc42FmJYdfDVytGbndeBMPomQ/ba9sX+wXMXgbvAo+CHYCqJgL9gPXgXHwWnAOn92/ur80/m3O+iedMfdybK0c+ey52HQOt35f0R07Pw=</latexit> S ik ∼ Norm ( μ ik , σ ) μ ik = β 0 k + β � k Age i + β 2 k Female i + β 3 k Black i Our two-level β 0 k = γ 00 + γ 0� Size k + γ 02 Exp i + model from last γ 03 TeacherFemale k + class γ 04 TeacherBlack k + γ 05 PropBlack k + η 0 k β � k = γ �0 + γ �� Size k + η � k β 2 k = γ 20 + γ 2� TeacherFemale k + η 2 k β 3 k = γ 30 + γ 3� TeacherBlack k + γ 32 PropBlack k + η 3 k 3
<latexit sha1_base64="z/O2lr1rLKTxBIZ91CfXy1f8Qyc=">AFN3ichVNb9NAEHVDgBK+WjhysaioihpFtvMFh0ilQNtDWwpS6Q4ijabibPyrm2t123Dan8Y/4IrJ26IK/+AtZO0cdWKlSzNvJl580aeGUSUxMKyfi4V7hTv3ru/KD08NHjJ09XVp+dxmHCMZzgkIa8M0AxUBLAiSCQifigNiAwteB/z6Nfz0DHpMwOBaTCHoMeQEZEYyEhvqrSz9clvQl8ZW53jLdAQjUl5b2NueO7at3HvTJFeL4agcYojmw6qtirDfJ65bWuBJWT3EWOpaGe3cs1WbfIO+v4g56uNFlNKWjgHhMfBZI39Ts670RgFImRSqpZU6rKqpmbZUwU6eR6pqyMeRpfwXNWVRDsv0c5JtBclztOvap18rZOrdWx1bYRLEmeRpJonqeZIqva1yRZjzg2zab+ypVsa1q02mY2mjUq83UcGp2rWGZdsXK3tqWaWTvqL9aOHSHIU4YBAJTFMd24pETyIuCKagSm4SQ6S7IA+62gwQg7gns91T5iuNDM1RyPUXCDNDFyskYnE8YQOdyZAYx9djKXhj7GLaoOQOYaSXO/MkmwxoAkp+2d1Wslov1xvl5ltVyksUozc9SYIoERDgqcJRQk0RmukFmEPCAQs60QbCnOghTxGHGh76Rk6rcoIxMWAVY6kpBCRXpCNAIuEQy3iTa3WMXTKbaz/desACTzeD8+BY32b5ewMWzPt0w4xCIZIkDJ1e3IP6BloIcg8hDRlGtaN0/jGB+IREZf39ckG5V0O4L/uHiZsoOW2dPuABF45XYW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yx1YJ9aZRVJLqTeprdR2+lv6R/pn+teoNbUwvPCmon079GX7Jj</latexit> μ ik = β 0 k + β � k Age i + β 2 k Female i + β 3 k Black i β 0 k = γ 00 + γ 0� Size k + γ 02 Exp i + TeacherFemale k + γ 04 TeacherBlack k + γ 05 PropBlack k + η 0 k β � k = γ �0 + γ �� Size k + η � k β 2 k = γ 20 + γ 2� TeacherFemale k + η 2 k β 3 k = γ 30 + γ 3� TeacherBlack k + γ 32 PropBlack k + η 3 k μ ik = ( γ 00 + γ 0� Size k + γ 02 Exp i + TeacherFemale k + γ 04 TeacherBlack k + γ 05 PropBlack k + η 0 k ) ( γ �0 + γ �� Size k + η � k ) Age i ( γ 20 + γ 2� TeacherFemale k + η 2 k ) Female i ( γ 30 + γ 3� TeacherBlack k + γ 32 PropBlack k + η 3 k ) Black i 4
<latexit sha1_base64="7TN0SMGmd2lFRM3eY1JhqgaJRaE=">AG43icnVRLb9NAEDZtCRCehSOXFRWoKFlJ3AIVIpz0MphbRQKYmizXaSrLJrW7troCz7C7ghrvwzvwRxnYSnNLyWiXS+pvxN98PL1YcG18/9uZufmFs6Vz5y+UL16fOXqtcXr3WUKAb7LBKROuhRDYKHsG+4EXAQK6CyJ+BNb/Qwtb95C0rzKNwzRzF0JB2EvM8ZNQh1F+c/tmXStXzkyJ0GW4PqJS0a3fkQqZPgWuyT9Ad1TEau7x+7jLSaW8B5QNQT0BSQU6Vdrt8p12PKShiaS1rmGdm7616sbeW4KyUeo8say5XRXFUxhMCo7cXWQjx+l+Cg1mhAZFoRlDgAwPBtDlv6epzdDUAncspylfDfnG4B8o6zOU9eBY4kVb7YTU6xgoR9I4+GtOu/Q/TSK/JHRCl8i/tqlYet9N6nwqLbYn8l1VgrFn5R0tgkT9C8GjBTKPi5bpVD7MfS7FoxdZjpxwiBP5rI4YVlSxREpjPp5pg/g2LNBX59vHtyV8J/PpGbZ3gZX2tvpFeaqvB6rpPghU/O0ubxMvObndxbqd9GLFEQmiYoFq3Aj82HUuV4UyAK7cTDTEGogNo4TWkEnTHZnvCkduIHJ+pPAfGpKhxTcslVofyR56SmqG+rgtBU+0vc8DlNuH0MdFlD1ZedQTCTj76umWs/W16tp6deO+K89KNP17HcvDODEQslxhPxHERCTdVuSQK2BGHOGFMsUxScKGVFmcKeVCZ6ijExYDMyhJZVCE2HSTPtATaJA20+yG+NPTioNhk2qfGcGjbcjt6BYrhHq9nKbIy15xE0GEl5mDK1OvYZiLeAQijZgdQlN2Pg1L78iA+40dVtXK9h9akCGN1t7Syh3IbGD7k4aCajlik0v1LhZsJeDq7kq0/ODbBNLF3kXiCOqygagA6e9bOhpHCgXT2xfMDZ/k7DOysRNiVcQInY0ZOv7yurQT1leDl6tLmVj6K3nvpnfLW/YCb8Pb9J5u96+x+a/L1xYuL5wowSlT6XPpS+569yZ8Ts3vJlT+voDGkxcSA=</latexit> Expanded notation μ ik = ( γ 00 + γ 0� Size k + γ 02 Exp i + TeacherFemale k + γ 04 TeacherBlack k + γ 05 PropBlack k + η 0 k ) ( γ �0 + γ �� Size k + η � k ) Age i ( γ 20 + γ 2� TeacherFemale k + η 2 k ) Female i ( γ 30 + γ 3� TeacherBlack k + γ 32 PropBlack k + η 3 k ) Black i S ik = γ 00 + γ 0� Size k + γ 02 Exp i + TeacherFemale k + γ 04 TeacherBlack k + γ 05 PropBlack k + γ �0 Age i γ �� Age i Size k + γ 20 Female i + γ 2� Female i TeacherFemale k + γ 30 Black i + γ 3� Black i TeacherBlack k + γ 32 Black i PropBlack k + η 0 k + η � k Age i + η 2 k Female i + η 3 k Black i + ε i 5
Expanded notation <latexit sha1_base64="7TN0SMGmd2lFRM3eY1JhqgaJRaE=">AG43icnVRLb9NAEDZtCRCehSOXFRWoKFlJ3AIVIpz0MphbRQKYmizXaSrLJrW7troCz7C7ghrvwzvwRxnYSnNLyWiXS+pvxN98PL1YcG18/9uZufmFs6Vz5y+UL16fOXqtcXr3WUKAb7LBKROuhRDYKHsG+4EXAQK6CyJ+BNb/Qwtb95C0rzKNwzRzF0JB2EvM8ZNQh1F+c/tmXStXzkyJ0GW4PqJS0a3fkQqZPgWuyT9Ad1TEau7x+7jLSaW8B5QNQT0BSQU6Vdrt8p12PKShiaS1rmGdm7616sbeW4KyUeo8say5XRXFUxhMCo7cXWQjx+l+Cg1mhAZFoRlDgAwPBtDlv6epzdDUAncspylfDfnG4B8o6zOU9eBY4kVb7YTU6xgoR9I4+GtOu/Q/TSK/JHRCl8i/tqlYet9N6nwqLbYn8l1VgrFn5R0tgkT9C8GjBTKPi5bpVD7MfS7FoxdZjpxwiBP5rI4YVlSxREpjPp5pg/g2LNBX59vHtyV8J/PpGbZ3gZX2tvpFeaqvB6rpPghU/O0ubxMvObndxbqd9GLFEQmiYoFq3Aj82HUuV4UyAK7cTDTEGogNo4TWkEnTHZnvCkduIHJ+pPAfGpKhxTcslVofyR56SmqG+rgtBU+0vc8DlNuH0MdFlD1ZedQTCTj76umWs/W16tp6deO+K89KNP17HcvDODEQslxhPxHERCTdVuSQK2BGHOGFMsUxScKGVFmcKeVCZ6ijExYDMyhJZVCE2HSTPtATaJA20+yG+NPTioNhk2qfGcGjbcjt6BYrhHq9nKbIy15xE0GEl5mDK1OvYZiLeAQijZgdQlN2Pg1L78iA+40dVtXK9h9akCGN1t7Syh3IbGD7k4aCajlik0v1LhZsJeDq7kq0/ODbBNLF3kXiCOqygagA6e9bOhpHCgXT2xfMDZ/k7DOysRNiVcQInY0ZOv7yurQT1leDl6tLmVj6K3nvpnfLW/YCb8Pb9J5u96+x+a/L1xYuL5wowSlT6XPpS+569yZ8Ts3vJlT+voDGkxcSA=</latexit> μ ik γ 00 γ 0� Size k γ 02 Exp i TeacherFemale k γ 04 TeacherBlack k γ 05 PropBlack k η 0 k Fixed effects Explained variation in γ �0 γ �� Size k η � k Age i outcome variable. γ 20 γ 2� TeacherFemale k η 2 k Female i Describes the way that outcome and predictor γ 30 γ 3� TeacherBlack k γ 32 PropBlack k η 3 k Black i variables co-vary. S ik = γ 00 + γ 0� Size k + γ 02 Exp i + TeacherFemale k + γ 04 TeacherBlack k + γ 05 PropBlack k + γ �0 Age i γ �� Age i Size k + γ 20 Female i + γ 2� Female i TeacherFemale k + γ 30 Black i + γ 3� Black i TeacherBlack k + γ 32 Black i PropBlack k + η 0 k + η � k Age i + η 2 k Female i + η 3 k Black i + ε i Random effects Unexplained variation in outcome variable. Described in terms of individual variability and different types of group variability. 6
Recommend
More recommend