<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Nonlinear | Emily A. Robinson</title>
    <link>https://emilyarobinson.com/tags/nonlinear/</link>
      <atom:link href="https://emilyarobinson.com/tags/nonlinear/index.xml" rel="self" type="application/rss+xml" />
    <description>Nonlinear</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Tue, 20 Aug 2019 00:00:00 +0000</lastBuildDate>
    <image>
      <url>img/map[gravatar:%!s(bool=false) shape:circle]</url>
      <title>Nonlinear</title>
      <link>https://emilyarobinson.com/tags/nonlinear/</link>
    </image>
    
    <item>
      <title>Non-linear Soybean Growth</title>
      <link>https://emilyarobinson.com/post/nonlinear-soybean-growth/</link>
      <pubDate>Tue, 20 Aug 2019 00:00:00 +0000</pubDate>
      <guid>https://emilyarobinson.com/post/nonlinear-soybean-growth/</guid>
      <description>


&lt;div id=&#34;introduction&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;The data in this study were collected in the Department of Crop Sciences at North Carolina State University and utilized in &lt;span class=&#34;citation&#34;&gt;Davidian (n.d.)&lt;/span&gt;. The objective of the study is to compare the growth curve of two soybean genotypes, Forrest (F) and Plant Introduction (P). Forest is a common commercial variety wherease Plant Introduction is an experimental strain. There are a total of 48 plants contained in the dataset with 8 to 10 average leaf weight per plant (g) taken at weekly increments. According to &lt;span class=&#34;citation&#34;&gt;Davidian (n.d.)&lt;/span&gt;, “At each sampling time, 6 plants were randomly selected from each plot, leaves from these plants were mixed together and weighted, and an average leaf weight per plant (g) was calcuated.” The summary of the average leaf weight per plant is shown in &lt;code&gt;Table 1&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;&lt;span id=&#34;tab:data&#34;&gt;Table 1: &lt;/span&gt;Summary of average weight per plant (g)&lt;/caption&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;left&#34;&gt;Variable&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;N&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Mean&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Minimum&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Maximum&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;left&#34;&gt;Forrest (F)&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;204&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;5.120&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.029&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;21.810&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;left&#34;&gt;Plant Introduction (P)&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;208&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;7.196&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.063&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;30.272&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class=&#34;figure&#34; style=&#34;text-align: center&#34;&gt;&lt;span id=&#34;fig:dataplot&#34;&gt;&lt;/span&gt;
&lt;img src=&#34;https://emilyarobinson.com/post/nonlinear-soybean-growth/index_files/figure-html/dataplot-1.png&#34; alt=&#34;Visual display of soybean growth by genotype.&#34; width=&#34;480&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;
Figure 1: Visual display of soybean growth by genotype.
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Soybeans tend to grow at a slower rate at the beginning of the season and then increase their growth rate until leveling off at the end of the season. This sigmoidal or S-shaped pattern is shown in the &lt;code&gt;Figure 1&lt;/code&gt;. The proposed non-linear function to fit the given data as a growth curve is the logistic growth model. We will consider both the three parameter model where&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
W(x;\boldsymbol\theta) = \frac{a}{1+be^{-cx}}
\]&lt;/span&gt;
as well as the four parameter model where&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[
W(x;\boldsymbol\theta) = a + \frac{b - a}{1+e^{(c-x)/d}}
\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;For each of the models above, &lt;span class=&#34;math inline&#34;&gt;\(x\)&lt;/span&gt; is the number of days after planting, and starting values for &lt;span class=&#34;math inline&#34;&gt;\(\boldsymbol\theta\)&lt;/span&gt; will be determined according to the initial and asymptotic average leaf weight per plant. We will determine the whether the 4-parameter logistic model is necessary by comparing Model (1) to Model (2) using likelihood ratios. After the correct model has been selected, we will compare the two genotypes and account for nonconstant variance. Finally, using &lt;code&gt;NLMIXED&lt;/code&gt; in &lt;code&gt;SAS&lt;/code&gt;, we will account for the within individual variation.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;model-selection&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Model Selection&lt;/h3&gt;
&lt;p&gt;In &lt;code&gt;Model (1)&lt;/code&gt;, &lt;span class=&#34;math inline&#34;&gt;\(a\)&lt;/span&gt; is defined as the asymptotic weight, while &lt;span class=&#34;math inline&#34;&gt;\(\frac{a}{1+b}\)&lt;/span&gt; is the initial weight, and &lt;span class=&#34;math inline&#34;&gt;\(c\)&lt;/span&gt; determines the growth rate. Selecting starting values of &lt;span class=&#34;math inline&#34;&gt;\(\hat{\boldsymbol\theta}=(20,700,0.125)^T\)&lt;/span&gt; and assuming the errors are normally distributed with constant variance, we fit &lt;code&gt;Model (1)&lt;/code&gt; using OLS (ordinary least squares) in the &lt;code&gt;NLS&lt;/code&gt; function found in the &lt;code&gt;Stat&lt;/code&gt; pakcage. We obtain &lt;span class=&#34;math inline&#34;&gt;\(\hat\sigma^2 = 5.13\)&lt;/span&gt; and parameter estimates provided in &lt;code&gt;Table 2&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;&lt;span id=&#34;tab:mod1&#34;&gt;Table 2: &lt;/span&gt;Estimated parameters for Model (1)&lt;/caption&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Estimate&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Std. Error&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;a&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;18.418&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.436&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;b&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;748.074&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;248.403&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;c&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.123&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.007&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In &lt;code&gt;Model (2)&lt;/code&gt;, &lt;span class=&#34;math inline&#34;&gt;\(b\)&lt;/span&gt; is defined as the asymptotic weight, &lt;span class=&#34;math inline&#34;&gt;\(a\)&lt;/span&gt; is used in defining the initial weight, and &lt;span class=&#34;math inline&#34;&gt;\(c\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(d\)&lt;/span&gt; determine the growth rate. Selecting starting values of &lt;span class=&#34;math inline&#34;&gt;\(\hat{\boldsymbol\theta} = (0.2, 20, 50,8)^T\)&lt;/span&gt; and assuming the errors are normally distributed with constant variance, we obtain &lt;span class=&#34;math inline&#34;&gt;\(\hat\sigma^2 = 5.13\)&lt;/span&gt; and parameter estimates provided in &lt;code&gt;Table 3&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;&lt;span id=&#34;tab:mod2&#34;&gt;Table 3: &lt;/span&gt;Estimated parameters for Model (2)&lt;/caption&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Estimate&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Std. Error&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;a&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.181&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.243&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;b&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;18.313&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.456&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;c&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;54.073&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.677&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;d&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;7.865&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.609&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Using extra sum of squares analyses to comparing Model (1) to Model (2), we obtain an F-ratio of 0.51 (p-value 0.48) and conclude the 3-parameter logistic model captures the growth pattern adequately. This is also verified conceptually since the initial leaf weight of plants is 0, and thus the extra parameter is unnecessary to capture this value.&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;(#tab:mod1_vs_mod2)Extra sum of squares model (1) vs model (2)&lt;/caption&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;right&#34;&gt;Res.Df&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Res.Sum Sq&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Df&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Sum Sq&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;F value&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Pr(&amp;gt;F)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;right&#34;&gt;409&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2096.80&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;right&#34;&gt;408&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2094.16&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2.63&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.51&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.47&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Evaluating &lt;code&gt;Model (1)&lt;/code&gt;, we can see there are nonconstant variance issues due to the fanning out of residuals as well as the possibility of differing parameters between genotypes.&lt;/p&gt;
&lt;div class=&#34;figure&#34; style=&#34;text-align: center&#34;&gt;
&lt;img src=&#34;https://emilyarobinson.com/post/nonlinear-soybean-growth/index_files/figure-html/mod1_fit-1.png&#34; alt=&#34;Model (1) fit&#34; width=&#34;480&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;
(#fig:mod1_fit)Model (1) fit
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;figure&#34; style=&#34;text-align: center&#34;&gt;
&lt;img src=&#34;https://emilyarobinson.com/post/nonlinear-soybean-growth/index_files/figure-html/mod1_resid-1.png&#34; alt=&#34;Model (1) residuals&#34; width=&#34;480&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;
(#fig:mod1_resid)Model (1) residuals
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;growth-pattern-due-to-genotype&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Growth Pattern due to Genotype&lt;/h3&gt;
&lt;p&gt;Define the indicator variable,&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[Genotype\_P=\begin{cases} 
      1 &amp;amp; Genotype = P \\
      0 &amp;amp; Genotype \ne P. 
   \end{cases}\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Consider incremental parameters, &lt;span class=&#34;math inline&#34;&gt;\(ap, bp,\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(cp\)&lt;/span&gt; accounting for the change in the parameter between the two genotypes. Starting values were selected by first fitting &lt;code&gt;Model (1)&lt;/code&gt; to each genotype individually to obtain &lt;span class=&#34;math inline&#34;&gt;\(\hat{\boldsymbol\theta} = (16, 4.78, 1035, -490,0.125, -0.01)^T\)&lt;/span&gt;. Fitting the full model,&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\begin{equation}
W(x;\boldsymbol\theta) = \frac{a+ap\cdot Genotype\_P}{1+(b+bp\cdot Genotype\_P)e^{-(c+cp\cdot Genotype\_P)x}}
\end{equation}\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;we obtain parameter estimates in &lt;code&gt;Table 4&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;&lt;span id=&#34;tab:mod3&#34;&gt;Table 4: &lt;/span&gt;Estimated parameters for Model (3)&lt;/caption&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Estimate&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Std. Error&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;a&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;16.037&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.516&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;ap&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;4.786&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.781&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;b&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1035.567&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;531.486&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;bp&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;-489.899&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;563.531&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;c&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.129&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.011&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;cp&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;-0.013&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.013&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Since we are unsure whether each of these incremental parameters are necessary, we will use extra sums of squares to determine the best fit. Fitting&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\begin{equation}
W(x;\boldsymbol\theta) = \frac{a}{1+(b+bp\cdot Genotype\_P)e^{-(c+cp\cdot Genotype\_P)x}},
\end{equation}\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;and comparing &lt;code&gt;Model (4)&lt;/code&gt; to &lt;code&gt;Model (3)&lt;/code&gt;, we conclude with an F value of 37.62 and p-value &amp;lt; 0.0001 that the incremental parameter, &lt;span class=&#34;math inline&#34;&gt;\(ap\)&lt;/span&gt; is necessary to keep in the model.&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;(#tab:mod4_vs_mod3)Extra sum of squares model (4) vs model (3)&lt;/caption&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;right&#34;&gt;Res.Df&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Res.Sum Sq&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Df&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Sum Sq&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;F value&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Pr(&amp;gt;F)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;right&#34;&gt;407&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1786.25&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;right&#34;&gt;406&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1634.77&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;151.47&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;37.62&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Fitting,&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;math display&#34;&gt;\[\begin{equation}
W(x;\boldsymbol\theta) = \frac{a+ap\cdot Genotype\_P}{1+(b)e^{-(c+cp\cdot Genotype\_P)x}},
\end{equation}\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;and comparing &lt;code&gt;Model (5)&lt;/code&gt; to &lt;code&gt;Model (3)&lt;/code&gt;, we conclude with an F value of 1.24 and p-value of 0.27 that the incremental parameter &lt;span class=&#34;math inline&#34;&gt;\(bp\)&lt;/span&gt; is not necessary to keep in the model.&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;(#tab:mod5_vs_mod3)Extra sum of squares model (5) vs model (3)&lt;/caption&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;right&#34;&gt;Res.Df&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Res.Sum Sq&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Df&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Sum Sq&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;F value&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Pr(&amp;gt;F)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;right&#34;&gt;407&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1639.78&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;right&#34;&gt;406&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1634.77&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;5&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.24&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.27&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Fitting
&lt;span class=&#34;math display&#34;&gt;\[\begin{equation}
W(x;\boldsymbol\theta) = \frac{a+ap\cdot Genotype\_P}{1+(b)e^{-(c)x}},
\end{equation}\]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;and comparing &lt;code&gt;Model (6)&lt;/code&gt; to &lt;code&gt;Model (5)&lt;/code&gt;, we conclude with an F value of 0.04 and p-value of 0.84 that the incremental parameter &lt;span class=&#34;math inline&#34;&gt;\(cp\)&lt;/span&gt; is not necessary to keep in the model.&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;(#tab:mod6_vs_mod5)Extra sum of squares model (6) vs model (5)&lt;/caption&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th align=&#34;right&#34;&gt;Res.Df&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Res.Sum Sq&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Df&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Sum Sq&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;F value&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Pr(&amp;gt;F)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td align=&#34;right&#34;&gt;408&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1639.93&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;NA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td align=&#34;right&#34;&gt;407&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1639.78&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.16&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.04&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.84&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;After comparing models, we conclude that &lt;code&gt;Model (6)&lt;/code&gt;, the 3-parameter logistic model with an incremental parameter due to genotype for parameter a, is the best fit. The estimated paramters are shown in &lt;code&gt;Table 8&lt;/code&gt; and the fitted values grouped by genotype are shown in &lt;code&gt;Figure 4&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;&lt;span id=&#34;tab:mod6&#34;&gt;Table 5: &lt;/span&gt;Estimated parameters for Model (6)&lt;/caption&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Estimate&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Std. Error&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;a&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;16.291&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.411&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;ap&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;4.273&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.409&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;b&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;695.142&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;199.701&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;c&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.121&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.006&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class=&#34;figure&#34; style=&#34;text-align: center&#34;&gt;
&lt;img src=&#34;https://emilyarobinson.com/post/nonlinear-soybean-growth/index_files/figure-html/mod6_fit-1.png&#34; alt=&#34;Model (6) fit.&#34; width=&#34;480&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;
(#fig:mod6_fit)Model (6) fit.
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Evaluating the residuals from &lt;code&gt;Model (6)&lt;/code&gt;, there is clear indication of nonconstant variance due to the fanning out of residuals.&lt;/p&gt;
&lt;div class=&#34;figure&#34; style=&#34;text-align: center&#34;&gt;
&lt;img src=&#34;https://emilyarobinson.com/post/nonlinear-soybean-growth/index_files/figure-html/mod6_resid-1.png&#34; alt=&#34;Model (6) residuals.&#34; width=&#34;480&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;
(#fig:mod6_resid)Model (6) residuals.
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Fitting &lt;code&gt;Model (6)&lt;/code&gt;, we now assume nonconstant variance and are not necessarily restricted to normally distributed errors. In particular, we model the variance using a function of &lt;span class=&#34;math inline&#34;&gt;\((f(x_i|\boldsymbol\theta), \psi\)&lt;/span&gt;, and other constants &lt;span class=&#34;math inline&#34;&gt;\(z_i\)&lt;/span&gt;. In general, &lt;span class=&#34;math inline&#34;&gt;\(Var(y_i) = \sigma^2g^2(\theta,\psi,z_i).\)&lt;/span&gt; Using GLS (generalized least squares) to estimate weights, we obtain &lt;span class=&#34;math inline&#34;&gt;\(\psi = 0.88\)&lt;/span&gt; and parameter estimates in &lt;code&gt;Table 9&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Estimate&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;Std.Error&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;a&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;14.975&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.246&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;ap&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;4.739&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.395&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;b&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;905.667&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;21.049&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;c&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.131&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.001&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Observing the studentized residuals produced by assuming nonconstant variance, we still determine there appears to be more going on. One possibility is the variability between plots.&lt;/p&gt;
&lt;div class=&#34;figure&#34; style=&#34;text-align: center&#34;&gt;
&lt;img src=&#34;https://emilyarobinson.com/post/nonlinear-soybean-growth/index_files/figure-html/mod7_diagnostics-1.png&#34; alt=&#34;Model (7) residuals.&#34; width=&#34;480&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;
(#fig:mod7_diagnostics)Model (7) residuals.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;experimental-design&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Experimental Design&lt;/h3&gt;
&lt;p&gt;The variability between plants may be affecting the model. We can accounting for this using a Nonlinear Mixed Effects Model. We will fit &lt;code&gt;Model 6&lt;/code&gt; assuming error terms that are normally and independently and identically distributed as well as a random effect, &lt;span class=&#34;math inline&#34;&gt;\(a_i\)&lt;/span&gt;, accounting for the variation due to the plot at the asymptotic leaf weight. Using &lt;code&gt;NLMIXED&lt;/code&gt; in &lt;code&gt;SAS&lt;/code&gt;, we obtain parameter estimates of,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;##                               Random Effects
## 
##                            The NLMIXED Procedure
## 
##                            Parameter Estimates
##  
##                      Standard                             95% Confidence
## Parameter  Estimate     Error    DF  t Value  Pr &amp;gt; |t|        Limits
## 
## a           14.9235    0.8175    47    18.26    &amp;lt;.0001   13.2790   16.5680
## ap           5.2961    1.0833    47     4.89    &amp;lt;.0001    3.1168    7.4753
## b            937.69   51.6136    47    18.17    &amp;lt;.0001    833.85   1041.52
## c            0.1314  0.002038    47    64.47    &amp;lt;.0001    0.1273    0.1355
## s2ai        12.1721    2.9228    47     4.16    0.0001    6.2922   18.0520
## s2          0.05810  0.005236    47    11.10    &amp;lt;.0001   0.04757   0.06863
## psi          0.9296   0.02791    47    33.31    &amp;lt;.0001    0.8735    0.9857
## 
##                             Parameter Estimates
##  
##                             Parameter  Gradient
## 
##                             a          0.000145
##                             ap         -0.00003
##                             b          2.066E-6
##                             c          -0.02470
##                             s2ai       -0.00003
##                             s2         0.009738
##                             psi        0.001264&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;conclusion&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Overall, the 3-parameter model with an incramental parameter to capture the varying asymptotic weights between genotypes and a random effect due to the plot variation is the best selection for modeling the leaf weight per plant (g) of soybeans over the days after planting. From the final model, the estimated asymptotic weight for a soybean with the Forrest (F) genotype is 14.92 g and for a soybean with the Plant Introduction (P) genotype is 20.22 g.&lt;/p&gt;
&lt;div style=&#34;page-break-after: always;&#34;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;code-appendix&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code Appendix&lt;/h3&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;library(knitr)
library(dplyr)
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(fig.width=7, fig.height=6, fig.align = &amp;quot;center&amp;quot;)
knitr::opts_chunk$set(tidy.opts=list(width.cutoff=50),tidy=TRUE)

library(SASmarkdown)
sas_enginesetup(sashtml=sashtml)
sasexe &amp;lt;- &amp;quot;C:/Program Files/SASHome/SASFoundation/9.4/sas.exe&amp;quot;
sasopts &amp;lt;- &amp;quot;-nosplash -ls 75&amp;quot;

resid_panel &amp;lt;- function(data = data, yhat = yhat, observed = y){
  require(ggplot2)
  require(gridExtra)
  e = observed - yhat
  resid1 &amp;lt;- ggplot(data, aes(x = yhat, y = e)) +
    geom_point() +
    geom_line(aes(y = 0)) +
    theme_minimal() +
    ggtitle(&amp;quot;Residual vs Predicted&amp;quot;)
  
  resid2 &amp;lt;- ggplot(data, aes(x = observed, y = e)) +
    geom_point() +
    geom_line(aes(y = 0)) +
    theme_minimal() +
    ggtitle(&amp;quot;Residual vs Observed&amp;quot;)
  
  resid3 &amp;lt;- ggplot(data, aes(x = yhat, y = e^2)) +
    geom_point() +
    theme_minimal() +
    ggtitle(&amp;quot;Sq. Residual vs Observed&amp;quot;)
  
  resid4 &amp;lt;- ggplot(data, aes(x = yhat, y = abs(e))) +
    geom_point() +
    theme_minimal() +
    ggtitle(&amp;quot;Abs. Residual vs Observed&amp;quot;)
  
  grid.arrange(resid1, resid2, resid3, resid4, ncol = 2)
}

corr_panel &amp;lt;- function(data = data2, x = x, e = e){
  require(ggplot2)
  require(gridExtra)
  
  corr_1 &amp;lt;- ggplot(data = data, aes(x = x, y = e)) +
    geom_point() +
    geom_smooth(se = F) +
    geom_line(aes(y = 0)) +
    theme_minimal() +
    ggtitle(&amp;quot;Distance vs Residual&amp;quot;)
  
  corr_2 &amp;lt;- ggplot(data = data, aes(x = lag(e), y = e)) +
    geom_point() +
    geom_smooth(se = F) +
    geom_line(aes(y = 0)) +
    theme_minimal() +
    ggtitle(paste(&amp;quot;Nth Residual vs (N-1)st Residual: \n Corr = &amp;quot;, round(cor(lag(e)[-1],e[-1]),4))) +
    xlab(&amp;quot;lag1_e&amp;quot;)
  corr_2
  
  corr_3 &amp;lt;- ggplot(data = data, aes(x = lag(lag(e)), y = e)) +
    geom_point() +
    geom_smooth(se = F) +
    geom_line(aes(y = 0)) +
    theme_minimal() +
    ggtitle(paste(&amp;quot;Nth Residual vs (N-2)nd Residual: \n Corr = &amp;quot;, round(cor(lag(lag(e))[-c(1:2)],e[-c(1:2)]),4), sep = &amp;quot;&amp;quot;)) +
    xlab(&amp;quot;lag2_e&amp;quot;)
  
  corr_4 &amp;lt;- ggplot(data = data, aes(x = lag(lag(lag(e))), y = e)) +
    geom_point() +
    geom_smooth(se = F) +
    geom_line(aes(y = 0)) +
    theme_minimal() +
    ggtitle(paste(&amp;quot;Nth Residual vs (N-3)rd Residual: \n Corr = &amp;quot;, round(cor(lag(lag(lag(e)))[-c(1:3)],e[-c(1:3)]),4), sep = &amp;quot;&amp;quot;)) +
    xlab(&amp;quot;lag3_e&amp;quot;)
  
  grid.arrange(corr_1, corr_2, corr_3, corr_4, ncol = 2)
  
}

studentized_resid_panel &amp;lt;- function(data = data, yhat = yhat, residual = residual, studentized_residual = studentized_residaul){
  plota &amp;lt;- ggplot(data, aes(x = log(yhat), y = residual)) +
      geom_point() +
      geom_line(aes(y = 0)) +
      theme_minimal() +
      xlab(&amp;quot;Log Predicted&amp;quot;) +
      ylab(&amp;quot;OLS Residuals&amp;quot;) +
      ggtitle(&amp;quot;Plot (a)&amp;quot;)
    
    plotb &amp;lt;- ggplot(data, aes(x = log(yhat), y = residual)) +
      geom_point() +
      geom_line(aes(y = 0)) +
      theme_minimal() +
      xlab(&amp;quot;Log Predicted&amp;quot;) +
      ylab(&amp;quot;Studentized Weighted Residuals&amp;quot;) +
      ggtitle(&amp;quot;Plot (b)&amp;quot;)
    
    plotc &amp;lt;- ggplot(data, aes(x = log(yhat), y = (studentized_residual^2)^(1/3))) +
      geom_point() +
      theme_minimal() +
      xlab(&amp;quot;Log Predicted Reaction Rate&amp;quot;) +
      ylab(&amp;quot;2/3 root of the Studentized Weighted Residuals&amp;quot;) +
      ggtitle(&amp;quot;Plot (c)&amp;quot;)
    coef(lm((studentized_residual^2)^(1/3) ~ log(yhat)))
    
    plotd &amp;lt;- ggplot(data, aes(x = log(yhat), y = log(abs(studentized_residual)))) +
      geom_point() +
      theme_minimal() +
      xlab(&amp;quot;Log Predicted Reaction Rate&amp;quot;) +
      ylab(&amp;quot;Log Absolute Studentized Weighted Residuals&amp;quot;) +
      ggtitle(&amp;quot;Plot (d)&amp;quot;)
    coef(lm(log(abs(studentized_residual)) ~ log(yhat)))
    
    grid.arrange(plota, plotb, plotc, plotd, ncol = 2)
    }
    soybean_data &amp;lt;- read.csv(&amp;quot;Data/soybean_data.csv&amp;quot;)
    cols &amp;lt;- c(1,3)
    soybean_data[cols]  &amp;lt;- lapply(soybean_data[cols], factor)
    Fsum &amp;lt;- summary(soybean_data[soybean_data$Genotype == &amp;quot;F&amp;quot;,])
    Psum &amp;lt;- summary(soybean_data[soybean_data$Genotype == &amp;quot;P&amp;quot;,])
    
    data_sum &amp;lt;- data.frame(&amp;quot;Variable&amp;quot; = c(&amp;quot;Forrest (F)&amp;quot;, &amp;quot;Plant Introduction (P)&amp;quot;),
                           &amp;quot;N&amp;quot;        = c(204,208),
                           &amp;quot;Mean&amp;quot;     = c(5.12,7.196),
                           &amp;quot;Minimum&amp;quot;  = c(0.029,0.063),
                           &amp;quot;Maximum&amp;quot;  =c(21.81,30.272))
    kable(data_sum, caption = &amp;quot;Summary of average weight per plant (g)&amp;quot;)
    library(ggplot2)
    ggplot(soybean_data, aes(x = Days, y = Leaf_Weight, group = Genotype, color = Genotype)) +
      geom_point() +
      geom_smooth(se = F) +
      theme_minimal() +
      xlab(&amp;quot;Days after Planting&amp;quot;) +
      ylab(&amp;quot;Average Leaf Weight/Plant (g)&amp;quot;)

mod1 &amp;lt;- nls(Leaf_Weight ~ a/(1+b*exp(-c*Days)), 
                 data = soybean_data, 
                 start = list(a = 20, b = 700,c = 0.125))
#summary(mod1)$sigma^2
kable(round(summary(mod1)$coeff[,1:2],3), caption = &amp;quot;Estimated parameters for Model (1)&amp;quot;)
mod2 &amp;lt;- nls(Leaf_Weight ~ a + (b-a)/(1+exp((c-Days)/d)), 
            data = soybean_data, 
            start = list(a = 0.2, b = 20,c = 50, d = 8))
# summary(mod2)$sigma^2
kable(round(summary(mod2)$coeff[,1:2],3), caption = &amp;quot;Estimated parameters for Model (2)&amp;quot;)
kable(round(anova(mod1, mod2),2), caption = &amp;quot;Extra sum of squares model (1) vs model (2)&amp;quot;)
    ggplot(soybean_data, aes(x = Days, y = Leaf_Weight, group = Genotype, color = Genotype)) +
      geom_point() +
      geom_line(aes(y = fitted(mod1)), color = &amp;quot;black&amp;quot;) +
      theme_minimal() +
      xlab(&amp;quot;Days after Planting&amp;quot;) +
      ylab(&amp;quot;Average Leaf Weight/Plant (g)&amp;quot;)
resid_panel(data = soybean_data, yhat = fitted(mod1), observed = soybean_data$Leaf_Weight)
library(fastDummies)
soybean_data2 &amp;lt;- soybean_data[order(soybean_data$Genotype),]
soybean_data2 &amp;lt;- dummy_cols(soybean_data2, select_columns = &amp;quot;Genotype&amp;quot;, remove_first_dummy = TRUE)
mod3 &amp;lt;- nls(Leaf_Weight ~ (a+ap*Genotype_P)/(1+(b+bp*Genotype_P)*exp(-(c+cp*Genotype_P)*Days)), 
            data = soybean_data2, 
            start = list(a = 16, ap = 4.78, b = 1035, bp = -490, c = 0.125, cp = -0.01))
kable(round(summary(mod3)$coeff[,1:2],3), caption = &amp;quot;Estimated parameters for Model (3)&amp;quot;)
# Take away ap? No
mod4 &amp;lt;- nls(Leaf_Weight ~ (a)/(1+(b+bp*Genotype_P)*exp(-(c+cp*Genotype_P)*Days)), 
            data = soybean_data2, 
            start = list(a = 20, b = 1035, bp = -490, c = 0.125, cp = -0.01))
kable(round(anova(mod4, mod3),2), caption = &amp;quot;Extra sum of squares model (4) vs model (3)&amp;quot;)
# Take away bp? Yes
mod5 &amp;lt;- nls(Leaf_Weight ~ (a + ap*Genotype_P)/(1+(b)*exp(-(c+cp*Genotype_P)*Days)), 
            data = soybean_data2, 
            start = list(a = 16, ap = 4.78, b = 700, c = 0.125, cp = -0.01))
kable(round(anova(mod5, mod3),2), caption = &amp;quot;Extra sum of squares model (5) vs model (3)&amp;quot;)
# Take away cp? Yes
mod6 &amp;lt;- nls(Leaf_Weight ~ (a + ap*Genotype_P)/(1+(b)*exp(-(c)*Days)), 
            data = soybean_data2, 
            start = list(a = 16, ap = 4.78, b = 700, c = 0.125))
kable(round(anova(mod6, mod5), 2), caption = &amp;quot;Extra sum of squares model (6) vs model (5)&amp;quot;)
kable(round(summary(mod6)$coeff[,1:2],3), caption = &amp;quot;Estimated parameters for Model (6)&amp;quot;)
    ggplot(soybean_data2, aes(x = Days, y = Leaf_Weight, group = Genotype, color = Genotype)) +
      geom_point() +
      geom_line(aes(y = fitted(mod6), group = Genotype, color = Genotype)) +
      theme_minimal() +
      xlab(&amp;quot;Days after Planting&amp;quot;) +
      ylab(&amp;quot;Average Leaf Weight/Plant (g)&amp;quot;)
resid_panel(data = soybean_data2, yhat = fitted(mod6), observed = soybean_data2$Leaf_Weight)
source(&amp;quot;WLS_function.R&amp;quot;)
mod7 &amp;lt;- WLS(y = soybean_data2$Leaf_Weight, x = soybean_data2$Days, 
            func = expression((a + b*soybean_data2$Genotype_P)/(1+c*exp(-d*x))), 
            theta0 = c(16, 4.78, 700, 0.125), 
            psi = 0.5, 
            tol = 10^{-8}, 
            maxiter = 20)
#mod7$psi
SE_theta &amp;lt;- sqrt(diag(as.numeric(mod7$sigma_sq)/(t(mod7$V)%*%mod7$W%*%mod7$V)))
theta_est &amp;lt;- data.frame(&amp;quot;Estimate&amp;quot; = round(mod7$theta,3), &amp;quot;Std.Error&amp;quot; = round(SE_theta,3))
rownames(theta_est) &amp;lt;- c(&amp;quot;a&amp;quot;, &amp;quot;ap&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;c&amp;quot;)
kable(theta_est)
studentized_resid_panel(data = soybean_data2, yhat = mod7$yhat, residual = mod7$OLS_resid, studentized_residual = mod7$studentized_resid)

PROC IMPORT
    DATAFILE = &amp;#39;C:\Users\ERobi\Box\University of Nebraska- Lincoln\Nonlinear\Soybean Growth\Data\soybean_data2.csv&amp;#39;
    OUT = soybean_data2
    REPLACE;
RUN;
    
TITLE &amp;quot;Random Effects&amp;quot;;   
ODS SELECT ParameterEstimates;
PROC NLMIXED DATA = soybean_data2;
    PARMS a = 16 ap = 4.78 b = 700 c = 0.125, s2ai = 1, s2 = 3, psi = 0.88;
    pred = (a+ap*Genotype_P+ai)/(1+b*exp(-c*Days));
    MODEL Leaf_Weight~ normal(pred,(pred**(2*psi))*s2);
    RANDOM ai  ~ normal(0,s2ai) SUBJECT = Plant_ID;
RUN;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&#34;page-break-after: always;&#34;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;references&#34; class=&#34;section level3 unnumbered&#34;&gt;
&lt;h3&gt;References&lt;/h3&gt;
&lt;div id=&#34;refs&#34; class=&#34;references&#34;&gt;
&lt;div id=&#34;ref-davidian&#34;&gt;
&lt;p&gt;Davidian, Marie. n.d. &lt;em&gt;ST 732 - Spring 2019&lt;/em&gt;. &lt;a href=&#34;https://www4.stat.ncsu.edu/~davidian/st732/notes.html&#34;&gt;https://www4.stat.ncsu.edu/~davidian/st732/notes.html&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
    </item>
    
  </channel>
</rss>
