<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.socr.umich.edu/index.php?action=history&amp;feed=atom&amp;title=SMHS_FixedRandomMixedModels</id>
	<title>SMHS FixedRandomMixedModels - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.socr.umich.edu/index.php?action=history&amp;feed=atom&amp;title=SMHS_FixedRandomMixedModels"/>
	<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;action=history"/>
	<updated>2026-06-04T22:28:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14399&amp;oldid=prev</id>
		<title>Clgalla: /* Theory */</title>
		<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14399&amp;oldid=prev"/>
		<updated>2014-10-16T15:52:53Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Theory&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 15:52, 16 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot; &gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect assumption: the individual specific effect is correlated with the independent variables. This is the priority criteria in using the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect assumption: the individual specific effect is correlated with the independent variables. This is the priority criteria in using the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model: consider the linear unobserved effects model for $N$ observations and $T$ time periods: $y_{it}=X_{it}\beta + \alpha_{i} + \mu_{it}, for t = 1, 2, \cdots, T$ and $i = 1, 2, \cdots, N$, where $y_{it}$ is the dependent variable observed for individual $i$ and time $t$, $X_{it}$ is the time variant $1xk$ regressor matrix, $\alpha_{i}$ is the unobserved time invariant individual effect and $u_{it}$ is the error term. $\alpha_{i}$ can’t be observed by the econometrician, common examples for time invariant effects $\alpha_{i}$ are innate ability for individuals or institutional factors for countries. The model allows $\alpha_{i}$ to be correlated with the regressor matrix, $x_{it}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model: consider the linear unobserved effects model for $N$ observations and $T$ time periods: $y_{it}=X_{it}\beta + \alpha_{i} + \mu_{it}, for t = 1, 2, \cdots, T$ and $i = 1, 2, \cdots, N$, where $y_{it}$ is the dependent variable observed for individual $i$ and time $t$, $X_{it}$ is the time variant $1xk$ regressor matrix, $\alpha_{i}$ is the unobserved time invariant individual effect and $u_{it}$ is the error term. $\alpha_{i}$ can’t be observed by the econometrician, common examples for time invariant effects $\alpha_{i}$ are innate ability for individuals or institutional factors for countries. The model allows $\alpha_{i}$ to be correlated with the regressor matrix, $x_{it}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*$\alpha_{i}$ is not observable and cannot be directly controlled for. The fixed effect model eliminates $\alpha_{i}$ by demeaning the variables using the within transformation: $y_{it} - \bar{y_{i}} = (X_{it} - \bar{X_{i}})\beta + (\alpha_{i} - \bar{\alpha_{i}}) + (\mu_{it} - \bar{mu_{it}}) \Rightarrow \ddot{y_{it}}=\ddot{X_{it}}\beta+\ddot{\mu_{it}}$, where $\bar{X_{i}}=\frac{1}{T}\sum_{t=1}^{T}X_{it}$, and $\bar{\mu_{i}}=\frac{1}{T} \sum_{t=1}^{T}\mu_{it}$, since $\alpha_{i}$ is constant, $\bar{\alpha_{i}}=\alpha_{i}$, hence the effect is eliminated. The fixed effect estimator $\hat{\beta_{FE}}$ is then obtained by an OLS regression of $\ddot{y}$ on $\ddot{X}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*$\alpha_{i}$ is not observable and cannot be directly controlled for. The fixed effect model eliminates $\alpha_{i}$ by demeaning the variables using the within transformation: $y_{it} - \bar{y_{i}} = (X_{it} - \bar{X_{i}})\beta + (\alpha_{i} - \bar{\alpha_{i}}) + (\mu_{it} - \bar{&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\&lt;/ins&gt;mu_{it}}) \Rightarrow \ddot{y_{it}}=\ddot{X_{it}}\beta+\ddot{\mu_{it}}$, where $\bar{X_{i}}=\frac{1}{T}\sum_{t=1}^{T}X_{it}$, and $\bar{\mu_{i}}=\frac{1}{T} \sum_{t=1}^{T}\mu_{it}$, since $\alpha_{i}$ is constant, $\bar{\alpha_{i}}=\alpha_{i}$, hence the effect is eliminated. The fixed effect estimator $\hat{\beta_{FE}}$ is then obtained by an OLS regression of $\ddot{y}$ on $\ddot{X}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Equality of Fixed Effects (FE) and First Differences (FD) estimator with the special case of T=2. That is the FE estimator effectively doubles the data set used in the FD estimator. $FE_{T=2}=[(x_{i1}-\bar{x_{i}})(x_{i1}-\bar{x_{i}})'+(x_{i2}-\bar{x_{i}})(x_{i2}-\bar{x_{i}})']^{-1}[(x_{i1}-\bar{x_{i}})(y_{i1}-\bar{y_{i}})+(x_{i2}-\bar{x_{i}})(y_{i2}-\bar{y_{i}})],$ since each $(x_{i1}-\bar{x_{i}})$ can be rewritten as $&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(&lt;/del&gt;x_{i1}-x_{i2}&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;)/&lt;/del&gt;2,$ &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Equality of Fixed Effects (FE) and First Differences (FD) estimator with the special case of T=2. That is the FE estimator effectively doubles the data set used in the FD estimator. $FE_{T=2}=[(x_{i1}-\bar{x_{i}})(x_{i1}-\bar{x_{i}})'+(x_{i2}-\bar{x_{i}})(x_{i2}-\bar{x_{i}})']^{-1}[(x_{i1}-\bar{x_{i}})(y_{i1}-\bar{y_{i}})+(x_{i2}-\bar{x_{i}})(y_{i2}-\bar{y_{i}})],$ since each $(x_{i1}-\bar{x_{i}})$ can be rewritten as $&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\frac{&lt;/ins&gt;x_{i1}-x_{i2}&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}{&lt;/ins&gt;2&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}&lt;/ins&gt;,$ &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;so $FE_{T=2}=[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{x_{i1}-x_{i2}'}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{y_{i1}-y_{i2}}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;so $FE_{T=2}=[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{x_{i1}-x_{i2}'}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{y_{i1}-y_{i2}}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Clgalla</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14398&amp;oldid=prev</id>
		<title>Clgalla: /* Theory */</title>
		<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14398&amp;oldid=prev"/>
		<updated>2014-10-16T15:47:09Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Theory&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 15:47, 16 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot; &gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model can be used to control for unobserved heterogeneity when this heterogeneity is constant over time and correlated with independent variables. The constant can be removed by differencing.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model can be used to control for unobserved heterogeneity when this heterogeneity is constant over time and correlated with independent variables. The constant can be removed by differencing.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect assumption: the individual specific effect is correlated with the independent variables. This is the priority criteria in using the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect assumption: the individual specific effect is correlated with the independent variables. This is the priority criteria in using the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model: consider the linear unobserved effects model for $N$ observations and $T$ time periods: $y_{it}=X_{it}\beta + \alpha_{i} + &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u_&lt;/del&gt;{it}, for t = 1, 2, \cdots, T$ and $i = 1, 2, \cdots, N$, where $y_{it}$ is the dependent variable observed for individual $i$ and time $t$, $X_{it}$ is the time variant $1xk$ regressor matrix, $\alpha_{i}$ is the unobserved time invariant individual effect and $u_{it}$ is the error term. $\alpha_{i}$ can’t be observed by the econometrician, common examples for time invariant effects $\alpha_{i}$ are innate ability for individuals or institutional factors for countries. The model allows $\alpha_{i}$ to be correlated with the regressor matrix, $x_{it}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model: consider the linear unobserved effects model for $N$ observations and $T$ time periods: $y_{it}=X_{it}\beta + \alpha_{i} + &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu_&lt;/ins&gt;{it}, for t = 1, 2, \cdots, T$ and $i = 1, 2, \cdots, N$, where $y_{it}$ is the dependent variable observed for individual $i$ and time $t$, $X_{it}$ is the time variant $1xk$ regressor matrix, $\alpha_{i}$ is the unobserved time invariant individual effect and $u_{it}$ is the error term. $\alpha_{i}$ can’t be observed by the econometrician, common examples for time invariant effects $\alpha_{i}$ are innate ability for individuals or institutional factors for countries. The model allows $\alpha_{i}$ to be correlated with the regressor matrix, $x_{it}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*$\alpha_{i}$ is not observable and cannot be directly controlled for. The fixed effect model eliminates $\alpha_{i}$ by demeaning the variables using the within transformation: $y_{it} - \bar{y_{i}} = (X_{it} - \bar{X_{i}})\beta + (\alpha_{i} - \bar{\alpha_{i}}) + (&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u_&lt;/del&gt;{it} - \bar{&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u_&lt;/del&gt;{it}}) \Rightarrow \ddot{y_{it}}=\ddot{X_{it}}\beta+\ddot{&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u_&lt;/del&gt;{it}}$, where $\bar{X_{i}}=\frac{1}{T}\sum_{t=1}^{T}X_{it}$, and $\bar{&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u_&lt;/del&gt;{i}}=\frac{1}{T} \sum_{t=1}^{T}&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u_&lt;/del&gt;{it}$, since $\alpha_{i}$ is constant, $\bar{\alpha_{i}}=\alpha_{i}$, hence the effect is eliminated. The fixed effect estimator $\hat{\beta_{FE}}$ is then obtained by an OLS regression of $\ddot{y}$ on $\ddot{X}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*$\alpha_{i}$ is not observable and cannot be directly controlled for. The fixed effect model eliminates $\alpha_{i}$ by demeaning the variables using the within transformation: $y_{it} - \bar{y_{i}} = (X_{it} - \bar{X_{i}})\beta + (\alpha_{i} - \bar{\alpha_{i}}) + (&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu_&lt;/ins&gt;{it} - \bar{&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;mu_&lt;/ins&gt;{it}}) \Rightarrow \ddot{y_{it}}=\ddot{X_{it}}\beta+\ddot{&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu_&lt;/ins&gt;{it}}$, where $\bar{X_{i}}=\frac{1}{T}\sum_{t=1}^{T}X_{it}$, and $\bar{&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu_&lt;/ins&gt;{i}}=\frac{1}{T} \sum_{t=1}^{T}&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu_&lt;/ins&gt;{it}$, since $\alpha_{i}$ is constant, $\bar{\alpha_{i}}=\alpha_{i}$, hence the effect is eliminated. The fixed effect estimator $\hat{\beta_{FE}}$ is then obtained by an OLS regression of $\ddot{y}$ on $\ddot{X}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Equality of Fixed Effects (FE) and First Differences (FD) estimator with the special case of T=2. That is the FE estimator effectively doubles the data set used in the FD estimator. $FE_{T=2}=[(x_{i1}-\bar{x_{i}})(x_{i1}-\bar{x_{i}})'+(x_{i2}-\bar{x_{i}})(x_{i2}-\bar{x_{i}})']^{-1}[(x_{i1}-\bar{x_{i}})(y_{i1}-\bar{y_{i}})+(x_{i2}-\bar{x_{i}})(y_{i2}-\bar{y_{i}})],$ since each $(x_{i1}-\bar{x_{i}})$ can be rewritten as $(x_{i1}-x_{i2})/2,$ &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Equality of Fixed Effects (FE) and First Differences (FD) estimator with the special case of T=2. That is the FE estimator effectively doubles the data set used in the FD estimator. $FE_{T=2}=[(x_{i1}-\bar{x_{i}})(x_{i1}-\bar{x_{i}})'+(x_{i2}-\bar{x_{i}})(x_{i2}-\bar{x_{i}})']^{-1}[(x_{i1}-\bar{x_{i}})(y_{i1}-\bar{y_{i}})+(x_{i2}-\bar{x_{i}})(y_{i2}-\bar{y_{i}})],$ since each $(x_{i1}-\bar{x_{i}})$ can be rewritten as $(x_{i1}-x_{i2})/2,$ &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;so$FE_{T=2}=[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{x_{i1}-x_{i2}'}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{y_{i1}-y_{i2}}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;so $FE_{T=2}=[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{x_{i1}-x_{i2}'}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{y_{i1}-y_{i2}}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$=[\sum_{i=1}^{N}2\frac{x_{i1}-x_{i2}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}2\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$=[\sum_{i=1}^{N}2\frac{x_{i1}-x_{i2}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}2\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot; &gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The random effects model can be applied to control for unobserved heterogeneity when this heterogeneity is constant over time and correlated with independent variables. The constant can be removed from the data through differencing. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The random effects model can be applied to control for unobserved heterogeneity when this heterogeneity is constant over time and correlated with independent variables. The constant can be removed from the data through differencing. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The random effect assumption: individual specific effects are uncorrelated with the independent variables. The random effects model is efficient and consistent only when this assumption is met.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The random effect assumption: individual specific effects are uncorrelated with the independent variables. The random effects model is efficient and consistent only when this assumption is met.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Suppose $m$ schools are chosen randomly from the united states to study on the math score of the 7th grade students. Suppose that $n$ students of the same age are randomly chosen from each selected school and their math scores are recorded. Let $Y_{ij}$ be the score of the $j^{th}$ student at the $i^{th}$ school. A simple model can be fitted $Y_{ij} = \mu + &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;U_&lt;/del&gt;{i} + W_{ij}$, where $\mu$ is the average test score for the entire population. In this model, $&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;U_&lt;/del&gt;{i}$ is the school-specific random effect, which measures the difference between the average math score at school $i$ and the average math score in the entire country. It is considered to be random because the school are randomly chosen form the contry. $W_{ij}$ is the individual-specific error. This is also random since the students within the school are random chosen. We can augment the model further by adding in additional explanatory variables, say teacher to student ratio. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Suppose $m$ schools are chosen randomly from the united states to study on the math score of the 7th grade students. Suppose that $n$ students of the same age are randomly chosen from each selected school and their math scores are recorded. Let $Y_{ij}$ be the score of the $j^{th}$ student at the $i^{th}$ school. A simple model can be fitted $Y_{ij} = \mu + &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu_&lt;/ins&gt;{i} + W_{ij}$, where $\mu$ is the average test score for the entire population. In this model, $&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu_&lt;/ins&gt;{i}$ is the school-specific random effect, which measures the difference between the average math score at school $i$ and the average math score in the entire country. It is considered to be random because the school are randomly chosen form the contry. $W_{ij}$ is the individual-specific error. This is also random since the students within the school are random chosen. We can augment the model further by adding in additional explanatory variables, say teacher to student ratio. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Variance components: the variance of $Y_{ij}$ is the sum of the variance $\tau^2$ and $\sigma^2$ of $U_{i}$ and $W_{ij}$ respectively. Let $\bar{Y_{i\cdot}}=\frac{1}{n} \sum_{j=1}^{n} Y_{ij}$ be the average of the $i^{th}$ school that are included in the random sample. Let $\bar{Y_{\cdot\cdot}} = \frac{1}{mn}\sum_{i=1}^{m}\sum_{j=1}{n}Y_{ij}$ be the grand average. Let $SSW = \sum_{i=1}^{m}\sum_{j=1}^{n}(Y_{ij}-\bar{Y_{i\cdot}})^2, SSB = n\sum_{i=1}^{m}(\bar{Y_{i\cdot}}-\bar{Y_{\cdot\cdot}})^2 $ are the sum of square due to differences within groups and the sum of squares due to difference between groups respectively. $\frac{1}{m(n-1)}E(SSW)=\sigma^2, \frac{1}{(m-1)n}E(SSB)=\frac{\sigma^2}{n+\tau^2}.$ This can be used to estimate the variance components $\sigma^2$ and $\tau^2$.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Variance components: the variance of $Y_{ij}$ is the sum of the variance $\tau^2$ and $\sigma^2$ of $U_{i}$ and $W_{ij}$ respectively. Let $\bar{Y_{i\cdot}}=\frac{1}{n} \sum_{j=1}^{n} Y_{ij}$ be the average of the $i^{th}$ school that are included in the random sample. Let $\bar{Y_{\cdot\cdot}} = \frac{1}{mn}\sum_{i=1}^{m}\sum_{j=1}{n}Y_{ij}$ be the grand average. Let $SSW = \sum_{i=1}^{m}\sum_{j=1}^{n}(Y_{ij}-\bar{Y_{i\cdot}})^2, SSB = n\sum_{i=1}^{m}(\bar{Y_{i\cdot}}-\bar{Y_{\cdot\cdot}})^2 $ are the sum of square due to differences within groups and the sum of squares due to difference between groups respectively. $\frac{1}{m(n-1)}E(SSW)=\sigma^2, \frac{1}{(m-1)n}E(SSB)=\frac{\sigma^2}{n+\tau^2}.$ This can be used to estimate the variance components $\sigma^2$ and $\tau^2$.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Comments on random effects model: in general the random effects model are efficient and should be used if the assumptions underlying are satisfied. For random effect to work in the school examples, the school-specific effects should be uncorrelated to other covariates of the model. A Hausman specification test can be used to test on this assumption as described in the previous Fixed Effects Model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Comments on random effects model: in general the random effects model are efficient and should be used if the assumptions underlying are satisfied. For random effect to work in the school examples, the school-specific effects should be uncorrelated to other covariates of the model. A Hausman specification test can be used to test on this assumption as described in the previous Fixed Effects Model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''3) Mixed models:''' a statistical model containing both fixed and random effects, which is widely used in varieties of disciplines, particularly useful for situations where repeated measurements are made on the same statistical units (longitudinal study), or where measurements are made on clusters of related statistical units. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''3) Mixed models:''' a statistical model containing both fixed and random effects, which is widely used in varieties of disciplines, particularly useful for situations where repeated measurements are made on the same statistical units (longitudinal study), or where measurements are made on clusters of related statistical units. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Mixed model formula (in matrix form): $y = X\beta + Zu+ \epsilon$, where $y$ is a vector of observations with mean $E(y) = X\beta$, $\beta$ is a vector of fixed effects, $&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u&lt;/del&gt;$ is a vector of random effects with mean $E(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u&lt;/del&gt;)=0$ and variance-covariance matrix $var(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u&lt;/del&gt;)=G$, $\epsilon$ is a vector of i.i.d. random error terms with mean $E(\epsilon)=0$ and variance $var(\epsilon)=R,$ $X$ and $Z$ are matrices of regressors relating the observations $y$ to $\beta$ and $&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u&lt;/del&gt;$, respectively.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Mixed model formula (in matrix form): $y = X\beta + Zu+ \epsilon$, where $y$ is a vector of observations with mean $E(y) = X\beta$, $\beta$ is a vector of fixed effects, $&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu&lt;/ins&gt;$ is a vector of random effects with mean $E(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu&lt;/ins&gt;)=0$ and variance-covariance matrix $var(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu&lt;/ins&gt;)=G$, $\epsilon$ is a vector of i.i.d. random error terms with mean $E(\epsilon)=0$ and variance $var(\epsilon)=R,$ $X$ and $Z$ are matrices of regressors relating the observations $y$ to $\beta$ and $&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu&lt;/ins&gt;$, respectively.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Estimation of Henderson’s mixed model equations (MME): $\begin{pmatrix} X'R^{-1}Z&amp;amp;X'R^{-1}Z\\ Z'R^{-1}X&amp;amp;Z'R^{-1}Z+G^{-1} \end{pmatrix} \bigl(\begin{smallmatrix} X'R^{-1}y\\Z'R^{-1}y \end{smallmatrix}\bigr).$ The solutions to the MME, $\tilde{\beta}$ and $\tilde{&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u&lt;/del&gt;}$ are the best linear unbiased estimates (BLUE) and predictors for $\beta$ and $&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;u&lt;/del&gt;$, respectively. When the conditional variance is known, the inverse variance weighed least squares estimate is BLUE, however, the conditional variance is rarely known. So it is desirable to jointly estimate the variance and weighted parameter estimates when solving MMEs. One method to fit such mixed models is that of EM algorithm, which can be implemented by lme in the nlme library in the R package.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Estimation of Henderson’s mixed model equations (MME): $\begin{pmatrix} X'R^{-1}Z&amp;amp;X'R^{-1}Z\\ Z'R^{-1}X&amp;amp;Z'R^{-1}Z+G^{-1} \end{pmatrix} \bigl(\begin{smallmatrix} X'R^{-1}y\\Z'R^{-1}y \end{smallmatrix}\bigr).$ The solutions to the MME, $\tilde{\beta}$ and $\tilde{&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu&lt;/ins&gt;}$ are the best linear unbiased estimates (BLUE) and predictors for $\beta$ and $&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\mu&lt;/ins&gt;$, respectively. When the conditional variance is known, the inverse variance weighed least squares estimate is BLUE, however, the conditional variance is rarely known. So it is desirable to jointly estimate the variance and weighted parameter estimates when solving MMEs. One method to fit such mixed models is that of EM algorithm, which can be implemented by lme in the nlme library in the R package.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''4) Comparing fixed effects model and random effects model:'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''4) Comparing fixed effects model and random effects model:'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Clgalla</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14396&amp;oldid=prev</id>
		<title>Clgalla: /* Theory */</title>
		<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14396&amp;oldid=prev"/>
		<updated>2014-10-16T13:51:55Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Theory&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:51, 16 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot; &gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Theory===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Theory===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1) &lt;/del&gt;'''Fixed effects model:''' a statistical model that represents the observed quantities in terms of explanatory variables treated as if they are non-random. The fixed effects estimator is used to refer to an estimator for the coefficients in the regression model and we impose time independent effects for each entity when we assume fixed effects for our model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1) &lt;/ins&gt;Fixed effects model:''' a statistical model that represents the observed quantities in terms of explanatory variables treated as if they are non-random. The fixed effects estimator is used to refer to an estimator for the coefficients in the regression model and we impose time independent effects for each entity when we assume fixed effects for our model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model can be used to control for unobserved heterogeneity when this heterogeneity is constant over time and correlated with independent variables. The constant can be removed by differencing.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model can be used to control for unobserved heterogeneity when this heterogeneity is constant over time and correlated with independent variables. The constant can be removed by differencing.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect assumption: the individual specific effect is correlated with the independent variables. This is the priority criteria in using the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect assumption: the individual specific effect is correlated with the independent variables. This is the priority criteria in using the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot; &gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**Conclude as to whether treatment effect significantly affects the variable of interest.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**Conclude as to whether treatment effect significantly affects the variable of interest.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Random effects model:'''a statistical model in which the dataset being analyzed consist of a hierarchy of different population whose differences relate to that hierarchy. It is in contrast of the fixed effects model where the data being studied on consist only of non-random variables.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;2) &lt;/ins&gt;Random effects model:'''a statistical model in which the dataset being analyzed consist of a hierarchy of different population whose differences relate to that hierarchy. It is in contrast of the fixed effects model where the data being studied on consist only of non-random variables.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The random effects model can be applied to control for unobserved heterogeneity when this heterogeneity is constant over time and correlated with independent variables. The constant can be removed from the data through differencing. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The random effects model can be applied to control for unobserved heterogeneity when this heterogeneity is constant over time and correlated with independent variables. The constant can be removed from the data through differencing. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The random effect assumption: individual specific effects are uncorrelated with the independent variables. The random effects model is efficient and consistent only when this assumption is met.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The random effect assumption: individual specific effects are uncorrelated with the independent variables. The random effects model is efficient and consistent only when this assumption is met.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l44&quot; &gt;Line 44:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Comments on random effects model: in general the random effects model are efficient and should be used if the assumptions underlying are satisfied. For random effect to work in the school examples, the school-specific effects should be uncorrelated to other covariates of the model. A Hausman specification test can be used to test on this assumption as described in the previous Fixed Effects Model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Comments on random effects model: in general the random effects model are efficient and should be used if the assumptions underlying are satisfied. For random effect to work in the school examples, the school-specific effects should be uncorrelated to other covariates of the model. A Hausman specification test can be used to test on this assumption as described in the previous Fixed Effects Model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;3) &lt;/del&gt;'''Mixed models:''' a statistical model containing both fixed and random effects, which is widely used in varieties of disciplines, particularly useful for situations where repeated measurements are made on the same statistical units (longitudinal study), or where measurements are made on clusters of related statistical units. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;3) &lt;/ins&gt;Mixed models:''' a statistical model containing both fixed and random effects, which is widely used in varieties of disciplines, particularly useful for situations where repeated measurements are made on the same statistical units (longitudinal study), or where measurements are made on clusters of related statistical units. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Mixed model formula (in matrix form): $y = X\beta + Zu+ \epsilon$, where $y$ is a vector of observations with mean $E(y) = X\beta$, $\beta$ is a vector of fixed effects, $u$ is a vector of random effects with mean $E(u)=0$ and variance-covariance matrix $var(u)=G$, $\epsilon$ is a vector of i.i.d. random error terms with mean $E(\epsilon)=0$ and variance $var(\epsilon)=R,$ $X$ and $Z$ are matrices of regressors relating the observations $y$ to $\beta$ and $u$, respectively.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Mixed model formula (in matrix form): $y = X\beta + Zu+ \epsilon$, where $y$ is a vector of observations with mean $E(y) = X\beta$, $\beta$ is a vector of fixed effects, $u$ is a vector of random effects with mean $E(u)=0$ and variance-covariance matrix $var(u)=G$, $\epsilon$ is a vector of i.i.d. random error terms with mean $E(\epsilon)=0$ and variance $var(\epsilon)=R,$ $X$ and $Z$ are matrices of regressors relating the observations $y$ to $\beta$ and $u$, respectively.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Estimation of Henderson’s mixed model equations (MME): $\begin{pmatrix} X'R^{-1}Z&amp;amp;X'R^{-1}Z\\ Z'R^{-1}X&amp;amp;Z'R^{-1}Z+G^{-1} \end{pmatrix} \bigl(\begin{smallmatrix} X'R^{-1}y\\Z'R^{-1}y \end{smallmatrix}\bigr).$ The solutions to the MME, $\tilde{\beta}$ and $\tilde{u}$ are the best linear unbiased estimates (BLUE) and predictors for $\beta$ and $u$, respectively. When the conditional variance is known, the inverse variance weighed least squares estimate is BLUE, however, the conditional variance is rarely known. So it is desirable to jointly estimate the variance and weighted parameter estimates when solving MMEs. One method to fit such mixed models is that of EM algorithm, which can be implemented by lme in the nlme library in the R package.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Estimation of Henderson’s mixed model equations (MME): $\begin{pmatrix} X'R^{-1}Z&amp;amp;X'R^{-1}Z\\ Z'R^{-1}X&amp;amp;Z'R^{-1}Z+G^{-1} \end{pmatrix} \bigl(\begin{smallmatrix} X'R^{-1}y\\Z'R^{-1}y \end{smallmatrix}\bigr).$ The solutions to the MME, $\tilde{\beta}$ and $\tilde{u}$ are the best linear unbiased estimates (BLUE) and predictors for $\beta$ and $u$, respectively. When the conditional variance is known, the inverse variance weighed least squares estimate is BLUE, however, the conditional variance is rarely known. So it is desirable to jointly estimate the variance and weighted parameter estimates when solving MMEs. One method to fit such mixed models is that of EM algorithm, which can be implemented by lme in the nlme library in the R package.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;4) &lt;/del&gt;'''Comparing fixed effects model and random effects model:'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;4) &lt;/ins&gt;Comparing fixed effects model and random effects model:'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Estimating the summary effect: under the fixed effect model, it is assumed that the true effect size for all studies is identical and the only reason the effect size varies between studies is sampling error. In situations like this, assigning equal weights to different studies largely ignore the information in smaller studies since more information are known about the same effect size in larger studies. In contrast, the random effect model aims to estimate the mean of a distribution of effects. The estimate provided by that study may be imprecise, but it is information about an effect that no other study has estimated. We cannot discount a small study by giving it a small weight, not can we give too much weight to a large study. Hence, in fixed-effect model, there is a wide range of weights while the weights in the random effects model fall in a relatively narrow range.&amp;#160; Study weights are more balanced under the random effect model than the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Estimating the summary effect: under the fixed effect model, it is assumed that the true effect size for all studies is identical and the only reason the effect size varies between studies is sampling error. In situations like this, assigning equal weights to different studies largely ignore the information in smaller studies since more information are known about the same effect size in larger studies. In contrast, the random effect model aims to estimate the mean of a distribution of effects. The estimate provided by that study may be imprecise, but it is information about an effect that no other study has estimated. We cannot discount a small study by giving it a small weight, not can we give too much weight to a large study. Hence, in fixed-effect model, there is a wide range of weights while the weights in the random effects model fall in a relatively narrow range.&amp;#160; Study weights are more balanced under the random effect model than the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*A fixed effect meta analysis estimates a single effect that is assumed to be common to every study while a random effects meta analysis estimates the mean of a distribution of effects. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*A fixed effect meta analysis estimates a single effect that is assumed to be common to every study while a random effects meta analysis estimates the mean of a distribution of effects. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Clgalla</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14395&amp;oldid=prev</id>
		<title>Clgalla: /* Software */</title>
		<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14395&amp;oldid=prev"/>
		<updated>2014-10-16T13:50:49Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Software&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:50, 16 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l63&quot; &gt;Line 63:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 63:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Software===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Software===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-mixed-models.pdf &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-mixed-models.pdf&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;lme (linear mixed effects) function in the nlme library&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;lme (linear mixed effects) function in the nlme library&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; RCODE:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; RCODE:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Clgalla</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14394&amp;oldid=prev</id>
		<title>Clgalla: /* Software */</title>
		<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14394&amp;oldid=prev"/>
		<updated>2014-10-16T13:50:11Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Software&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:50, 16 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l70&quot; &gt;Line 70:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 70:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; library(lattice) ## for Trellis graphics&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; library(lattice) ## for Trellis graphics&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; data(MathAchieve)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; data(MathAchieve)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; MathAchieve[1:10,]&amp;#160;  # first 10 students; relates to 7185 students; SES:the socioeconomic status &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/del&gt;of the student’s family, centered to the overall mean of 0; MathAch: the student’s score on a math- achievement test; Sector: factor coded ‘Catholic’or ‘Public’; MEANSES: mean SES for student in each school.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; MathAchieve[1:10,]&amp;#160;  # first 10 students; relates to 7185 students; SES:the socioeconomic status&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;of the student’s family, centered to the overall mean of 0; MathAch: the student’s score on a &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;math-achievement test; Sector: factor coded ‘Catholic’or ‘Public’; MEANSES: mean SES for student &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;in each school.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; Grouped Data: MathAch ~ SES | School&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; Grouped Data: MathAch ~ SES | School&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Clgalla</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14393&amp;oldid=prev</id>
		<title>Clgalla: /* References */</title>
		<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14393&amp;oldid=prev"/>
		<updated>2014-10-16T13:49:18Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;References&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:49, 16 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l120&quot; &gt;Line 120:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 120:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===References===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===References===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;http://mirlyn.lib.umich.edu/Record/004199238 &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/ins&gt;http://mirlyn.lib.umich.edu/Record/004199238 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Statistical inference &lt;/ins&gt;/ &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;George Casella, Roger L&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Berger]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;http://mirlyn.lib.umich.edu/Record/004232056 &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;http:&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;/mirlyn&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;lib.umich.edu/Record/004133572 &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://mirlyn.lib.umich.edu/Record/004232056&amp;#160; Sampling / Steven K. Thompson]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://mirlyn.lib.umich.edu/Record/004133572 Sampling theory and methods / S. Sampath]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Clgalla</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14392&amp;oldid=prev</id>
		<title>Clgalla at 13:41, 16 October 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14392&amp;oldid=prev"/>
		<updated>2014-10-16T13:41:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:41, 16 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l58&quot; &gt;Line 58:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 58:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Applications===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Applications===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1) [http://www.tandfonline.com/doi/abs/10.1080/01621459.1984.10477102#.U-2PdhZTWdA&amp;#160; This article] proposed approximations for standard errors of estimators of fixed, and random effects in mixed linear models. Best linear unbiased estimators of the fixed and random effects of mixed linear models are available when the true values of the variance ratios are known. If the true values are replaced by estimated values, the mean squared errors of the estimators of the fixed and random effects increase in size. The magnitude of this increase is investigated, and a general approximation is proposed. The performance of this approximation is investigated in the context of (a) the estimation of the effects of the balanced one-way random model and (b) the estimation of treatment contrasts for balanced incomplete block designs. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[http://www.tandfonline.com/doi/abs/10.1080/01621459.1984.10477102#.U-2PdhZTWdA&amp;#160;  This article] proposed approximations for standard errors of estimators of fixed, and random effects in mixed linear models. Best linear unbiased estimators of the fixed and random effects of mixed linear models are available when the true values of the variance ratios are known. If the true values are replaced by estimated values, the mean squared errors of the estimators of the fixed and random effects increase in size. The magnitude of this increase is investigated, and a general approximation is proposed. The performance of this approximation is investigated in the context of (a) the estimation of the effects of the balanced one-way random model and (b) the estimation of treatment contrasts for balanced incomplete block designs. &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;2) [http://amstat.tandfonline.com/doi/abs/10.1080/01621459.1955.10501298#.U-2P1xZTWdA This article] discussed about the fixed, mixed and random models. Some explicit questions are raised regarding the adequacy of assumed linear models as a basis for the interpretation of the analysis of variance of randomized experiments. A generally applicable method for the derivation of a linear statistical model, based on the experimental situation and the design of the experiment, is exemplified. The central features of the method are the notion of “experimental unit,” the concept of “true response,” and the use of randomization in the design. A model is derived for the case where two factors having A and B levels respectively, are to be examined with respect to a population of P experimental units, where selection of levels of the factors to be tested, selection of experimental units to be used, and the allocation of selected treatment combinations to units is at random. First a linear population model is given, based on the structure of the experimental situation, whose components are (unknown) parameters of the population of (conceptual) “true” responses. Then the conditions of the design are imposed to obtain a linear statistical model whose components involve the parameters of the population model and some defined random variables reflecting the experimental procedure and design. The derived statistical model is then used to obtain expected mean squares in the analyses of variance. A second illustration of the general methodology is given for a more complex example originated by Vaurio and Daniel and discussed statistically by Scheffé. Some differences from Scheffé's results are noted.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[http://amstat.tandfonline.com/doi/abs/10.1080/01621459.1955.10501298#.U-2P1xZTWdA&amp;#160; This article] discussed about the fixed, mixed and random models. Some explicit questions are raised regarding the adequacy of assumed linear models as a basis for the interpretation of the analysis of variance of randomized experiments. A generally applicable method for the derivation of a linear statistical model, based on the experimental situation and the design of the experiment, is exemplified. The central features of the method are the notion of “experimental unit,” the concept of “true response,” and the use of randomization in the design. A model is derived for the case where two factors having A and B levels respectively, are to be examined with respect to a population of P experimental units, where selection of levels of the factors to be tested, selection of experimental units to be used, and the allocation of selected treatment combinations to units is at random. First a linear population model is given, based on the structure of the experimental situation, whose components are (unknown) parameters of the population of (conceptual) “true” responses. Then the conditions of the design are imposed to obtain a linear statistical model whose components involve the parameters of the population model and some defined random variables reflecting the experimental procedure and design. The derived statistical model is then used to obtain expected mean squares in the analyses of variance. A second illustration of the general methodology is given for a more complex example originated by Vaurio and Daniel and discussed statistically by Scheffé. Some differences from Scheffé's results are noted.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;===Software=== &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-mixed-models.pdf&amp;#160; Linear Mixed Models] lme (linear mixed effects) function in the nlme library.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; RCODE:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; library(nlme)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; library(lattice) ## for Trellis graphics&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; data(MathAchieve)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; MathAchieve[1:10,]&amp;#160;  # first 10 students; relates to 7185 students; SES: the socioeconomic status&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; of the student’s family, centered to the overall mean of 0; MathAch: the student’s score on a math- achievement test; Sector: factor coded ‘Catholic’ or ‘Public’; MEANSES: mean SES for student in&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; each school.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; Grouped Data: MathAch ~ SES | School&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; School Minority&amp;#160; &amp;#160; Sex&amp;#160; &amp;#160; SES MathAch MEANSES&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1&amp;#160; &amp;#160; 1224&amp;#160; &amp;#160; &amp;#160;  No Female -1.528&amp;#160;  5.876&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 2&amp;#160; &amp;#160; 1224&amp;#160; &amp;#160; &amp;#160;  No Female -0.588&amp;#160; 19.708&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 3&amp;#160; &amp;#160; 1224&amp;#160; &amp;#160; &amp;#160;  No&amp;#160;  Male -0.528&amp;#160; 20.349&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 4&amp;#160; &amp;#160; 1224&amp;#160; &amp;#160; &amp;#160;  No&amp;#160;  Male -0.668&amp;#160;  8.781&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 5&amp;#160; &amp;#160; 1224&amp;#160; &amp;#160; &amp;#160;  No&amp;#160;  Male -0.158&amp;#160; 17.898&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 6&amp;#160; &amp;#160; 1224&amp;#160; &amp;#160; &amp;#160;  No&amp;#160;  Male&amp;#160; 0.022&amp;#160;  4.583&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 7&amp;#160; &amp;#160; 1224&amp;#160; &amp;#160; &amp;#160;  No Female -0.618&amp;#160; -2.832&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 8&amp;#160; &amp;#160; 1224&amp;#160; &amp;#160; &amp;#160;  No&amp;#160;  Male -0.998&amp;#160;  0.523&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 9&amp;#160; &amp;#160; 1224&amp;#160; &amp;#160; &amp;#160;  No Female -0.888&amp;#160;  1.527&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 10&amp;#160;  1224&amp;#160; &amp;#160; &amp;#160;  No&amp;#160;  Male -0.458&amp;#160; 21.521&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; data(MathAchSchool)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; MathAchSchool[1:10,]&amp;#160; # fist 10 schools; relates to 160 schools&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160;  School Size&amp;#160;  Sector PRACAD DISCLIM HIMINTY MEANSES&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1224&amp;#160;  1224&amp;#160; 842&amp;#160;  Public&amp;#160;  0.35&amp;#160;  1.597&amp;#160; &amp;#160; &amp;#160;  0&amp;#160; -0.428&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1288&amp;#160;  1288 1855&amp;#160;  Public&amp;#160;  0.27&amp;#160;  0.174&amp;#160; &amp;#160; &amp;#160;  0&amp;#160;  0.128&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1296&amp;#160;  1296 1719&amp;#160;  Public&amp;#160;  0.32&amp;#160; -0.137&amp;#160; &amp;#160; &amp;#160;  1&amp;#160; -0.420&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1308&amp;#160;  1308&amp;#160; 716 Catholic&amp;#160;  0.96&amp;#160; -0.622&amp;#160; &amp;#160; &amp;#160;  0&amp;#160;  0.534&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1317&amp;#160;  1317&amp;#160; 455 Catholic&amp;#160;  0.95&amp;#160; -1.694&amp;#160; &amp;#160; &amp;#160;  1&amp;#160;  0.351&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1358&amp;#160;  1358 1430&amp;#160;  Public&amp;#160;  0.25&amp;#160;  1.535&amp;#160; &amp;#160; &amp;#160;  0&amp;#160; -0.014&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1374&amp;#160;  1374 2400&amp;#160;  Public&amp;#160;  0.50&amp;#160;  2.016&amp;#160; &amp;#160; &amp;#160;  0&amp;#160; -0.007&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1433&amp;#160;  1433&amp;#160; 899 Catholic&amp;#160;  0.96&amp;#160; -0.321&amp;#160; &amp;#160; &amp;#160;  0&amp;#160;  0.718&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1436&amp;#160;  1436&amp;#160; 185 Catholic&amp;#160;  1.00&amp;#160; -1.141&amp;#160; &amp;#160; &amp;#160;  0&amp;#160;  0.569&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; 1461&amp;#160;  1461 1672&amp;#160;  Public&amp;#160;  0.78&amp;#160;  2.096&amp;#160; &amp;#160; &amp;#160;  0&amp;#160;  0.683&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; attach(MathAchieve)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; attach(MathAchSchool)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; mses &amp;lt;- tapply(SES, School, mean)&amp;#160; ## school means&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; mses[as.character(MathAchSchool$School[1:10])]&amp;#160;  # for first 10 schools&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;….. &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; Check the R example in the attached file at [http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-mixed-models.pdf Fox-Companion].&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;===Problems===&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;I like the above example – but can we use one of the [http://wiki.socr.umich.edu/index.php/SOCR_Data&amp;#160; SOCR Datasets] to demonstrate the same linear mixed effect modeling in a different setting? For example, can we replicate the same analysis protocol using either [http://wiki.socr.umich.edu/index.php/SOCR_Data_121608_OzoneData&amp;#160; Ozone Data] (where location acts as a grouping variable, school in the previous example), [http://wiki.socr.umich.edu/index.php/SOCR_Data_Dinov_011709_PRB_Data PRB Data]or [http://wiki.socr.umich.edu/index.php/SOCR_Data_2008_World_CountriesRankings World Countries Rankings]&amp;#160; datasets.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;===References===&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;http://mirlyn.lib.umich.edu/Record/004199238 &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;http://mirlyn.lib.umich.edu/Record/004232056&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;http://mirlyn.lib.umich.edu/Record/004133572&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;===Applications===&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1) [http://www.tandfonline.com/doi/abs/10.1080/01621459.1984.10477102#.U-2PdhZTWdA&amp;#160; This article ] proposed approximations for standard errors of estimators of fixed, and random effects in mixed linear models. Best linear unbiased estimators of the fixed and random effects of mixed linear models are available when the true values of the variance ratios are known. If the true values are replaced by estimated values, the mean squared errors of the estimators of the fixed and random effects increase in size. The magnitude of this increase is investigated, and a general approximation is proposed. The performance of this approximation is investigated in the context of (a) the estimation of the effects of the balanced one-way random model and (b) the estimation of treatment contrasts for balanced incomplete block designs. &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;2) [http://amstat.tandfonline.com/doi/abs/10.1080/01621459.1955.10501298#.U-2P1xZTWdA This article ] discussed about the fixed, mixed and random models. Some explicit questions are raised regarding the adequacy of assumed linear models as a basis for the interpretation of the analysis of variance of randomized experiments. A generally applicable method for the derivation of a linear statistical model, based on the experimental situation and the design of the experiment, is exemplified. The central features of the method are the notion of “experimental unit,” the concept of “true response,” and the use of randomization in the design. A model is derived for the case where two factors having A and B levels respectively, are to be examined with respect to a population of P experimental units, where selection of levels of the factors to be tested, selection of experimental units to be used, and the allocation of selected treatment combinations to units is at random. First a linear population model is given, based on the structure of the experimental situation, whose components are (unknown) parameters of the population of (conceptual) “true” responses. Then the conditions of the design are imposed to obtain a linear statistical model whose components involve the parameters of the population model and some defined random variables reflecting the experimental procedure and design. The derived statistical model is then used to obtain expected mean squares in the analyses of variance. A second illustration of the general methodology is given for a more complex example originated by Vaurio and Daniel and discussed statistically by Scheffé. Some differences from Scheffé's results are noted.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Software===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Software===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l132&quot; &gt;Line 132:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 70:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; library(lattice) ## for Trellis graphics&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; library(lattice) ## for Trellis graphics&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; data(MathAchieve)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; data(MathAchieve)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; MathAchieve[1:10,]&amp;#160;  # first 10 students; relates to 7185 students; SES: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; MathAchieve[1:10,]&amp;#160;  # first 10 students; relates to 7185 students; SES:the socioeconomic status&amp;#160;  of the student’s family, centered to the overall mean of 0; MathAch: the student’s score on a math- achievement test; Sector: factor coded &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;‘Catholic’or &lt;/ins&gt;‘Public’; MEANSES: mean SES for student in each school.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;the socioeconomic status&amp;#160;  of the student’s family, centered to the overall mean of 0; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;MathAch: the student’s score on a math- achievement test; Sector: factor coded &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;‘Catholic’&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; or &lt;/del&gt;‘Public’; MEANSES: mean SES for student in each school.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; Grouped Data: MathAch ~ SES | School&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; Grouped Data: MathAch ~ SES | School&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; School Minority&amp;#160; &amp;#160; Sex&amp;#160; &amp;#160; SES MathAch MEANSES&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; School Minority&amp;#160; &amp;#160; Sex&amp;#160; &amp;#160; SES MathAch MEANSES&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l169&quot; &gt;Line 169:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 105:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; mses[as.character(MathAchSchool$School[1:10])]&amp;#160;  # for first 10 schools&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; mses[as.character(MathAchSchool$School[1:10])]&amp;#160;  # for first 10 schools&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;….. &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Check the R example in the attached file at http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-mixed-models.pdf .&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Check the R example in the attached file at http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-mixed-models.pdf .&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Clgalla</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14391&amp;oldid=prev</id>
		<title>Clgalla: /* Theory */</title>
		<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14391&amp;oldid=prev"/>
		<updated>2014-10-16T13:30:51Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Theory&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;a href=&quot;https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;amp;diff=14391&amp;amp;oldid=14390&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Clgalla</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14390&amp;oldid=prev</id>
		<title>Clgalla at 21:03, 15 October 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14390&amp;oldid=prev"/>
		<updated>2014-10-15T21:03:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 21:03, 15 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot; &gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect assumption: the individual specific effect is correlated with the independent variables. This is the priority criteria in using the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect assumption: the individual specific effect is correlated with the independent variables. This is the priority criteria in using the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model: consider the linear unobserved effects model for $N$ observations and $T$ time periods: $y_{it}=X_{it}\beta + \alpha_{i} + u_{it}, for t = 1, 2, \cdots, T$ and $i = 1, 2, \cdots, N$, where $y_{it}$ is the dependent variable observed for individual $i$ and time $t$, $X_{it}$ is the time variant $1xk$ regressor matrix, $\alpha_{i}$ is the unobserved time invariant individual effect and $u_{it}$ is the error term. $\alpha_{i}$ can’t be observed by the econometrician, common examples for time invariant effects $\alpha_{i}$ are innate ability for individuals or institutional factors for countries. The model allows $\alpha_{i}$ to be correlated with the regressor matrix, $x_{it}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model: consider the linear unobserved effects model for $N$ observations and $T$ time periods: $y_{it}=X_{it}\beta + \alpha_{i} + u_{it}, for t = 1, 2, \cdots, T$ and $i = 1, 2, \cdots, N$, where $y_{it}$ is the dependent variable observed for individual $i$ and time $t$, $X_{it}$ is the time variant $1xk$ regressor matrix, $\alpha_{i}$ is the unobserved time invariant individual effect and $u_{it}$ is the error term. $\alpha_{i}$ can’t be observed by the econometrician, common examples for time invariant effects $\alpha_{i}$ are innate ability for individuals or institutional factors for countries. The model allows $\alpha_{i}$ to be correlated with the regressor matrix, $x_{it}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*$\alpha_{i}$ is not observable and cannot be directly controlled for. The fixed effect model eliminates $\alpha_{i}$ by demeaning the variables using the within transformation: $y_{it} - \bar{y_{i}} = (X_{it} - \bar{X_{i}})\beta + \alpha_{i} - \bar{\alpha_{i}}) + (u_{it} - \bar{u_{it}}) \Rightarrow \ddot{y_{it}}=\ddot{X_{it}}\beta+\ddot{u_{it}}$, where $\bar{X_{i}}=1/T \sum_{t=1}^{T}X_{it}$, and $\bar{u_{i}}=1/T \sum_{t=1}^{T}u_{it}$, since $\alpha_{i}$ is constant, $\bar{\alpha_{i}}=\alpha_{i}$, hence the effect is eliminated. The fixed effect estimator $\hat{\beta_{FE}}$ is then obtained by an OLS regression of $\ddot{y}$ on $\ddot{X}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*$\alpha_{i}$ is not observable and cannot be directly controlled for. The fixed effect model eliminates $\alpha_{i}$ by demeaning the variables using the within transformation: $y_{it} - \bar{y_{i}} = (X_{it} - \bar{X_{i}})\beta + &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(&lt;/ins&gt;\alpha_{i} - \bar{\alpha_{i}}) + (u_{it} - \bar{u_{it}}) \Rightarrow \ddot{y_{it}}=\ddot{X_{it}}\beta+\ddot{u_{it}}$, where $\bar{X_{i}}=1/T \sum_{t=1}^{T}X_{it}$, and $\bar{u_{i}}=1/T \sum_{t=1}^{T}u_{it}$, since $\alpha_{i}$ is constant, $\bar{\alpha_{i}}=\alpha_{i}$, hence the effect is eliminated. The fixed effect estimator $\hat{\beta_{FE}}$ is then obtained by an OLS regression of $\ddot{y}$ on $\ddot{X}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Equality of Fixed Effects (FE) and First Differences (FD) estimator with the special case of T=2. That is the FE estimator effectively doubles the data set used in the FD estimator. $FE_{T=2}=[(x_{i1}-\bar{x_{i}})(x_{i1}-\bar{x_{i}})'+(x_{i2}-\bar{x_{i}})(x_{i2}-\bar{x_{i}})']^{-1}[(x_{i1}-\bar{x_{i}})(y_{i1}-\bar{y_{i}})+(x_{i2}-\bar{x_{i}})(y_{i2}-\bar{y_{i}})],$ since each $(x_{i1}-\bar{x_{i}})$ can be rewritten as $(x_{i1}-x_{i2})/2,&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;$ so $FE_{T=2}=[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{x_{i1}-x_{i2}'}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{y_{i1}-y_{i2}}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]&lt;/del&gt;$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Equality of Fixed Effects (FE) and First Differences (FD) estimator with the special case of T=2. That is the FE estimator effectively doubles the data set used in the FD estimator. $FE_{T=2}=[(x_{i1}-\bar{x_{i}})(x_{i1}-\bar{x_{i}})'+(x_{i2}-\bar{x_{i}})(x_{i2}-\bar{x_{i}})']^{-1}[(x_{i1}-\bar{x_{i}})(y_{i1}-\bar{y_{i}})+(x_{i2}-\bar{x_{i}})(y_{i2}-\bar{y_{i}})],$ since each $(x_{i1}-\bar{x_{i}})$ can be rewritten as $(x_{i1}-x_{i2})/2,$ &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=[\sum_{i=1}^{N}2\frac{x_{i1}-x_{i2}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}2\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]=[\sum_{i=1}^{N}(x_{i2}-x_{i1}x_{i2}-x_{i1}']^{-1}\sum_{i=1}^{N}(x_{i2}-x_{i1})(y_{i2}-y_{i1})=FD_{T=2}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;so$FE_{T=2}=[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{x_{i1}-x_{i2}'}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{y_{i1}-y_{i2}}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]&lt;/ins&gt;=[\sum_{i=1}^{N}2\frac{x_{i1}-x_{i2}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}2\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Hausman-Taylor method: need more than one time-variant regressor $(X)$ and time invariant regressor $(Z)$ and at least one $X$ and one $Z$ that are uncorrelated with $&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;/&lt;/del&gt;alpha_{i}$, partition the $X$ and $Z$ variables such that&amp;#160; $X=[X_{1it}\vdots X_{2it}], Z=[Z_{1it}\vdots Z_{2it}]$ where $X_{1}$ and $Z_{1}$ are uncorrelated with $\alpha_{i}.$ Need $K1 &amp;gt; G2.$ Estimating $\gamma via OLS on \hat{di} = Z_{i}\gamma + \varphi_{it},$ using $X_{1}$ and $Z_{1}$ as instruments yields a consistent estimate.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=[\sum_{i=1}^{N}(x_{i2}-x_{i1}x_{i2}-x_{i1}']^{-1}\sum_{i=1}^{N}(x_{i2}-x_{i1})(y_{i2}-y_{i1})=FD_{T=2}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Hausman-Taylor method: need more than one time-variant regressor $(X)$ and time invariant regressor $(Z)$ and at least one $X$ and one $Z$ that are uncorrelated with $&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\&lt;/ins&gt;alpha_{i}$, partition the $X$ and $Z$ variables such that&amp;#160; $X=[X_{1it}\vdots X_{2it}], Z=[Z_{1it}\vdots Z_{2it}]$ where $X_{1}$ and $Z_{1}$ are uncorrelated with $\alpha_{i}.$ Need $K1 &amp;gt; G2.$ Estimating $\gamma via OLS on \hat{di} = Z_{i}\gamma + \varphi_{it},$ using $X_{1}$ and $Z_{1}$ as instruments yields a consistent estimate.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Testing FE vs. RE with a Hausman test: $H_{0}: \alpha_{i}$ independent from $X_{it}$, $Z_{it}$ vs. $H_{a}: \alpha_{i}$ not independent $X_{it}$, $Z_{it}$. If $H_{0}$ is true, both $\hat{\beta_{RE}}$ and $\hat{\beta_{FE}}$ are consistent, but only $\hat{\beta_{RE}}$ is efficient. If $H_{a}$ is true, $\hat{\beta_{FE}}$ is consistent and $\hat{\beta_{RE}}$ not. $\hat{Q}$ = $\hat{\beta_{RE}}-\hat{\beta_{FE}}$, $\hat{HT}= T\hat{Q’}[Var(\hat{\beta_{FE}})-var(\hat{\beta_{RE}})]^{-1}\hat{Q} \sim \chi_{k}^2,$ where $K = dim(Q)$. The Hausman test is a specification test so a large test statistic might be indication that there might be errors in variables or the model is misspecified. If the fixed effect assumption is true, $\hat{\beta_{LD}} \approx \hat{\beta_{FD}} \approx \hat{\beta_{FE}}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Testing FE vs. RE with a Hausman test: $H_{0}: \alpha_{i}$ independent from $X_{it}$, $Z_{it}$ vs. $H_{a}: \alpha_{i}$ not independent $X_{it}$, $Z_{it}$. If $H_{0}$ is true, both $\hat{\beta_{RE}}$ and $\hat{\beta_{FE}}$ are consistent, but only $\hat{\beta_{RE}}$ is efficient. If $H_{a}$ is true, $\hat{\beta_{FE}}$ is consistent and $\hat{\beta_{RE}}$ not. $\hat{Q}$ = $\hat{\beta_{RE}}-\hat{\beta_{FE}}$, $\hat{HT}= T\hat{Q’}[Var(\hat{\beta_{FE}})-var(\hat{\beta_{RE}})]^{-1}\hat{Q} \sim \chi_{k}^2,$ where $K = dim(Q)$. The Hausman test is a specification test so a large test statistic might be indication that there might be errors in variables or the model is misspecified. If the fixed effect assumption is true, $\hat{\beta_{LD}} \approx \hat{\beta_{FD}} \approx \hat{\beta_{FE}}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; 	&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; 	&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Clgalla</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14389&amp;oldid=prev</id>
		<title>Clgalla: /* Theory */</title>
		<link rel="alternate" type="text/html" href="https://wiki.socr.umich.edu/index.php?title=SMHS_FixedRandomMixedModels&amp;diff=14389&amp;oldid=prev"/>
		<updated>2014-10-15T20:58:42Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Theory&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:58, 15 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot; &gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect assumption: the individual specific effect is correlated with the independent variables. This is the priority criteria in using the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect assumption: the individual specific effect is correlated with the independent variables. This is the priority criteria in using the fixed effect model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model: consider the linear unobserved effects model for $N$ observations and $T$ time periods: $y_{it}=X_{it}\beta + \alpha_{i} + u_{it}, for t = 1, 2, \cdots, T$ and $i = 1, 2, \cdots, N$, where $y_{it}$ is the dependent variable observed for individual $i$ and time $t$, $X_{it}$ is the time variant $1xk$ regressor matrix, $\alpha_{i}$ is the unobserved time invariant individual effect and $u_{it}$ is the error term. $\alpha_{i}$ can’t be observed by the econometrician, common examples for time invariant effects $\alpha_{i}$ are innate ability for individuals or institutional factors for countries. The model allows $\alpha_{i}$ to be correlated with the regressor matrix, $x_{it}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*The fixed effect model: consider the linear unobserved effects model for $N$ observations and $T$ time periods: $y_{it}=X_{it}\beta + \alpha_{i} + u_{it}, for t = 1, 2, \cdots, T$ and $i = 1, 2, \cdots, N$, where $y_{it}$ is the dependent variable observed for individual $i$ and time $t$, $X_{it}$ is the time variant $1xk$ regressor matrix, $\alpha_{i}$ is the unobserved time invariant individual effect and $u_{it}$ is the error term. $\alpha_{i}$ can’t be observed by the econometrician, common examples for time invariant effects $\alpha_{i}$ are innate ability for individuals or institutional factors for countries. The model allows $\alpha_{i}$ to be correlated with the regressor matrix, $x_{it}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*$\alpha_{i}$ is not observable and cannot be directly controlled for. The fixed effect model eliminates $\alpha_{i}$ by demeaning the variables using the within transformation: $y_{it} - \bar{y_{i}} = (X_{it} - \bar{X_{i}})\beta + &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(&lt;/del&gt;\alpha_{i} - \bar{\alpha_{i}}) + (u_{it} - \bar{u_{it}}) \Rightarrow \ddot{y_{it}}=\ddot{X_{it}}\beta+\ddot{u_{it}}$, where $\bar{X_{i}}=1/T \sum_{t=1}^{T}X_{it}$, and $\bar{u_{i}}=1/T \sum_{t=1}^{T}u_{it}$, since $\alpha_{i}$ is constant, $\bar{\alpha_{i}}=\alpha_{i}$, hence the effect is eliminated. The fixed effect estimator $\hat{\beta_{FE}}$ is then obtained by an OLS regression of $\ddot{y}$ on $\ddot{X}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*$\alpha_{i}$ is not observable and cannot be directly controlled for. The fixed effect model eliminates $\alpha_{i}$ by demeaning the variables using the within transformation: $y_{it} - \bar{y_{i}} = (X_{it} - \bar{X_{i}})\beta + \alpha_{i} - \bar{\alpha_{i}}) + (u_{it} - \bar{u_{it}}) \Rightarrow \ddot{y_{it}}=\ddot{X_{it}}\beta+\ddot{u_{it}}$, where $\bar{X_{i}}=1/T \sum_{t=1}^{T}X_{it}$, and $\bar{u_{i}}=1/T \sum_{t=1}^{T}u_{it}$, since $\alpha_{i}$ is constant, $\bar{\alpha_{i}}=\alpha_{i}$, hence the effect is eliminated. The fixed effect estimator $\hat{\beta_{FE}}$ is then obtained by an OLS regression of $\ddot{y}$ on $\ddot{X}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Equality of Fixed Effects (FE) and First Differences (FD) estimator with the special case of T=2. That is the FE estimator effectively doubles the data set used in the FD estimator. $FE_{T=2}=[(x_{i1}-\bar{x_{i}})(x_{i1}-\bar{x_{i}})'+(x_{i2}-\bar{x_{i}})(x_{i2}-\bar{x_{i}})']^{-1}[(x_{i1}-\bar{x_{i}})(y_{i1}-\bar{y_{i}})+(x_{i2}-\bar{x_{i}})(y_{i2}-\bar{y_{i}})],$ since each $(x_{i1}-\bar{x_{i}})$ can be rewritten as $(x_{i1}-x_{i2})/2,$ so $FE_{T=2}=[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{x_{i1}-x_{i2}'}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{y_{i1}-y_{i2}}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]=[\sum_{i=1}^{N}2\frac{x_{i1}-x_{i2}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}2\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]=[\sum_{i=1}^{N}(x_{i2}-x_{i1}x_{i2}-x_{i1}']^{-1}\sum_{i=1}^{N}(x_{i2}-x_{i1})(y_{i2}-y_{i1})=FD_{T=2}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Equality of Fixed Effects (FE) and First Differences (FD) estimator with the special case of T=2. That is the FE estimator effectively doubles the data set used in the FD estimator. $FE_{T=2}=[(x_{i1}-\bar{x_{i}})(x_{i1}-\bar{x_{i}})'+(x_{i2}-\bar{x_{i}})(x_{i2}-\bar{x_{i}})']^{-1}[(x_{i1}-\bar{x_{i}})(y_{i1}-\bar{y_{i}})+(x_{i2}-\bar{x_{i}})(y_{i2}-\bar{y_{i}})],$ since each $(x_{i1}-\bar{x_{i}})$ can be rewritten as $(x_{i1}-x_{i2})/2,$ so $FE_{T=2}=[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{x_{i1}-x_{i2}'}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}\frac{x_{i1}-x_{i2}}{2}\frac{y_{i1}-y_{i2}}{2}+\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;$&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=[\sum_{i=1}^{N}2\frac{x_{i1}-x_{i2}}{2}\frac{x_{i2}-x_{i1}'}{2}]^{-1}[\sum_{i=1}^{N}2\frac{x_{i2}-x_{i1}}{2}\frac{y_{i2}-y_{i1}}{2}]=[\sum_{i=1}^{N}(x_{i2}-x_{i1}x_{i2}-x_{i1}']^{-1}\sum_{i=1}^{N}(x_{i2}-x_{i1})(y_{i2}-y_{i1})=FD_{T=2}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Hausman-Taylor method: need more than one time-variant regressor $(X)$ and time invariant regressor $(Z)$ and at least one $X$ and one $Z$ that are uncorrelated with $/alpha_{i}$, partition the $X$ and $Z$ variables such that&amp;#160; $X=[X_{1it}\vdots X_{2it}], Z=[Z_{1it}\vdots Z_{2it}]$ where $X_{1}$ and $Z_{1}$ are uncorrelated with $\alpha_{i}.$ Need $K1 &amp;gt; G2.$ Estimating $\gamma via OLS on \hat{di} = Z_{i}\gamma + \varphi_{it},$ using $X_{1}$ and $Z_{1}$ as instruments yields a consistent estimate.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Hausman-Taylor method: need more than one time-variant regressor $(X)$ and time invariant regressor $(Z)$ and at least one $X$ and one $Z$ that are uncorrelated with $/alpha_{i}$, partition the $X$ and $Z$ variables such that&amp;#160; $X=[X_{1it}\vdots X_{2it}], Z=[Z_{1it}\vdots Z_{2it}]$ where $X_{1}$ and $Z_{1}$ are uncorrelated with $\alpha_{i}.$ Need $K1 &amp;gt; G2.$ Estimating $\gamma via OLS on \hat{di} = Z_{i}\gamma + \varphi_{it},$ using $X_{1}$ and $Z_{1}$ as instruments yields a consistent estimate.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Testing FE vs. RE with a Hausman test: $H_{0}: \alpha_{i}$ independent from $X_{it}$, $Z_{it}$ vs. $H_{a}: \alpha_{i}$ not independent $X_{it}$, $Z_{it}$. If $H_{0}$ is true, both $\hat{\beta_{RE}}$ and $\hat{\beta_{FE}}$ are consistent, but only $\hat{\beta_{RE}}$ is efficient. If $H_{a}$ is true, $\hat{\beta_{FE}}$ is consistent and $\hat{\beta_{RE}}$ not. $\hat{Q}$ = $\hat{\beta_{RE}}-\hat{\beta_{FE}}$, $\hat{HT}= T\hat{Q’}[Var(\hat{\beta_{FE}})-var(\hat{\beta_{RE}})]^{-1}\hat{Q} \sim \chi_{k}^2,$ where $K = dim(Q)$. The Hausman test is a specification test so a large test statistic might be indication that there might be errors in variables or the model is misspecified. If the fixed effect assumption is true, $\hat{\beta_{LD}} \approx \hat{\beta_{FD}} \approx \hat{\beta_{FE}}.$&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Testing FE vs. RE with a Hausman test: $H_{0}: \alpha_{i}$ independent from $X_{it}$, $Z_{it}$ vs. $H_{a}: \alpha_{i}$ not independent $X_{it}$, $Z_{it}$. If $H_{0}$ is true, both $\hat{\beta_{RE}}$ and $\hat{\beta_{FE}}$ are consistent, but only $\hat{\beta_{RE}}$ is efficient. If $H_{a}$ is true, $\hat{\beta_{FE}}$ is consistent and $\hat{\beta_{RE}}$ not. $\hat{Q}$ = $\hat{\beta_{RE}}-\hat{\beta_{FE}}$, $\hat{HT}= T\hat{Q’}[Var(\hat{\beta_{FE}})-var(\hat{\beta_{RE}})]^{-1}\hat{Q} \sim \chi_{k}^2,$ where $K = dim(Q)$. The Hausman test is a specification test so a large test statistic might be indication that there might be errors in variables or the model is misspecified. If the fixed effect assumption is true, $\hat{\beta_{LD}} \approx \hat{\beta_{FD}} \approx \hat{\beta_{FE}}.$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Clgalla</name></author>
		
	</entry>
</feed>