Practical Application of Dose-response Functions in Weed Science
William J. Price
Statistical ProgramsCollege of Agricultural and Life Sciences
University of Idaho, Moscow, Idaho
• Statistical Estimation Software
• S+
• R
• Statistica, etc.
• Sigma Plot, AXUM, etc.
• SAS
• Normal: yij = (1/2) exp((x-)2/2
• Logistic: yij = 1 / (1 + exp( -dosei - ))
• Modified Logistic: yij = C + (D-C) / (1 + exp( -Bdosei - ))) (e.g. Seefeldt et al. 1995)
• Gompertz: yij = 0 (1 - exp(exp(-(dose))))
yij = 0 exp(-(dose))
• Exponential: yij = 0 [1 - exp(-(dose))]
Common Dose-response Models
• Logistic: yij = 1 / (1 + exp( -dosei - ))
• Modified Logistic: yij = C + (D-C) / (1 + exp( -Bdosei - I))) (e.g. Seefeldt et al. 1995)
Probit Maximum Likelihood• Data description
• Vernalization study.
• Fixed number of wheat plants• 6 to 10 wheat plants per replication and temperature.• (SAS: plants).
• Five temperatures (doses):• 0, -10, -12, -14, and -16 degrees celcius• (SAS: temp = temperature + 17).
• Number of wheat plants alive after 2 weeks recorded • (SAS: alive2wk).
Temperature
0
.25
.50
.75
1.00
-16 0
Pro
po
rtio
n A
live
Vernalization Data
proc probit data=freeze log optc lackfit inversecl;model alive2wk/plants = temp/distribution=logistic ;predpplot var=temp;
proc probit data=freeze log optc lackfit inversecl;model alive2wk/plants = temp/distribution=logistic ;predpplot var=temp;
• Code:
Probit Maximum Likelihood
• SAS Procedure: PROC PROBIT.
proc probit data=freeze log optc lackfit inversecl;model alive2wk/plants = temp/distribution=logistic ;predpplot var=temp;
proc probit data=freeze log optc lackfit inversecl;model alive2wk/plants = temp/distribution=logistic ;predpplot var=temp;
proc probit data=freeze log optc lackfit inversecl;model alive2wk/plants = temp/distribution=logistic;predpplot var=temp;
proc probit data=freeze log optc lackfit inversecl;model alive2wk/plants = temp/distribution=logistic;predpplot var=temp;
proc probit data=freeze log optc lackfit inversecl;model alive2wk/plants = temp/distribution=logistic ;predpplot var=temp;
proc probit data=freeze log optc lackfit inversecl;model alive2wk/plants = temp/distribution=logistic ;predpplot var=temp;
Probit Procedure
Model Information
Data Set WORK.FREEZEEvents Variable alive2wkTrials Variable plantsNumber of Observations 20Number of Events 122Number of Trials 195Name of Distribution LogisticLog Likelihood -83.4877251
Number of Observations Read 20Number of Observations Used 20Number of Events 122Number of Trials 195Missing Values 0
Algorithm converged.
Probit Procedure
Model Information
Data Set WORK.FREEZEEvents Variable alive2wkTrials Variable plantsNumber of Observations 20Number of Events 122Number of Trials 195Name of Distribution LogisticLog Likelihood -83.4877251
Number of Observations Read 20Number of Observations Used 20Number of Events 122Number of Trials 195Missing Values 0
Algorithm converged.
Goodness-of-Fit Tests
Statistic Value DF Pr > ChiSq
Pearson Chi-Square 18.7054 17 0.3457L.R. Chi-Square 22.6138 17 0.1623
Response-Covariate Profile
Response Levels 2Number of Covariate Values 20
Type III Analysis of Effects
WaldEffect DF Chi-Square Pr > ChiSq
Ln(temp) 1 15.2620 <.0001
Goodness-of-Fit Tests
Statistic Value DF Pr > ChiSq
Pearson Chi-Square 18.7054 17 0.3457L.R. Chi-Square 22.6138 17 0.1623
Response-Covariate Profile
Response Levels 2Number of Covariate Values 20
Type III Analysis of Effects
WaldEffect DF Chi-Square Pr > ChiSq
Ln(temp) 1 15.2620 <.0001
PROC PROBIT Output
PROC PROBIT Output (cont)
Analysis of Parameter Estimates
Standard 95% Confidence Chi-Parameter DF Estimate Error Limits Square Pr > ChiSq
Intercept 1 -6.9144 2.0126 -10.8590 -2.9699 11.80 0.0006Ln(temp) 1 4.5094 1.1543 2.2470 6.7717 15.26 <.0001_C_ 1 0.2258 0.0623 0.1037 0.3480
Probability temp 95% Fiducial Limits
0.01 1.67252 0.48881 2.54641 0.02 1.95482 0.66670 2.83256 . . . . . . . . . . . . 0.40 4.23519 3.00063 4.96946 0.45 4.43197 3.25697 5.16920 0.50 4.63365 3.52170 5.38443 0.55 4.84451 3.79739 5.62420 0.60 5.06959 4.08622 5.90119 . . . . . . . . . . . . 0.99 12.83734 9.46539 30.51920
Analysis of Parameter Estimates
Standard 95% Confidence Chi-Parameter DF Estimate Error Limits Square Pr > ChiSq
Intercept 1 -6.9144 2.0126 -10.8590 -2.9699 11.80 0.0006Ln(temp) 1 4.5094 1.1543 2.2470 6.7717 15.26 <.0001_C_ 1 0.2258 0.0623 0.1037 0.3480
Probability temp 95% Fiducial Limits
0.01 1.67252 0.48881 2.54641 0.02 1.95482 0.66670 2.83256 . . . . . . . . . . . . 0.40 4.23519 3.00063 4.96946 0.45 4.43197 3.25697 5.16920 0.50 4.63365 3.52170 5.38443 0.55 4.84451 3.79739 5.62420 0.60 5.06959 4.08622 5.90119 . . . . . . . . . . . . 0.99 12.83734 9.46539 30.51920
PROC PROBIT Output (cont)
Temperature (C)
-16 0
0
.25
.50
.75
1.00
OPTC = 0.23
Pro
po
rtio
n A
live
• Probit Limitations• Proportional Data.• Maximum set to 1.0.• Limited number of response models.
• Probit Advantages• Automatic Goodness of Fit test.• Easily computed percentiles.• Ability to do treatment comparisons.• Graphic output.
PROC PROBIT (cont)
• Code:
proc nlin data=freeze ; parms I = 8 B = -4.5 C = .12; bounds B<0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));model per2 = mu;output out=pred p=pred;
proc nlin data=freeze ; parms I = 8 B = -4.5 C = .12; bounds B<0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));model per2 = mu;output out=pred p=pred;
Nonlinear Least Squares
• SAS Procedure: PROC NLIN
proc nlin data=freeze ; parms I = 8 B = -4.5 C = .12; bounds B<0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));model per2 = mu;output out=pred p=pred;
proc nlin data=freeze ; parms I = 8 B = -4.5 C = .12; bounds B<0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));model per2 = mu;output out=pred p=pred;
proc nlin data=freeze ; parms I = 8 B = -4.5 C = .12; bounds B<0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));model per2 = mu;output out=pred p=pred;
proc nlin data=freeze ; parms I = 8 B = -4.5 C = .12; bounds B<0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));model per2 = mu;output out=pred p=pred;
The NLIN ProcedureDependent Variable per2Method: Gauss-Newton
Iterative Phase Sum of Iter I B C Squares
0 4.6000 -4.6000 0.2200 0.3767 1 4.6147 -4.6464 0.2268 0.3765 2 4.6119 -4.6366 0.2264 0.3765 3 4.6125 -4.6388 0.2265 0.3765 4 4.6123 -4.6383 0.2265 0.3765 5 4.6124 -4.6384 0.2265 0.3765
NOTE: Convergence criterion met.
Estimation Summary
Method Gauss-NewtonIterations 5R 3.628E-6PPC(B) 4.559E-6RPC(B) 0.000021Object 2.25E-10Objective 0.37647Observations Read 20Observations Used 20Observations Missing 0
The NLIN ProcedureDependent Variable per2Method: Gauss-Newton
Iterative Phase Sum of Iter I B C Squares
0 4.6000 -4.6000 0.2200 0.3767 1 4.6147 -4.6464 0.2268 0.3765 2 4.6119 -4.6366 0.2264 0.3765 3 4.6125 -4.6388 0.2265 0.3765 4 4.6123 -4.6383 0.2265 0.3765 5 4.6124 -4.6384 0.2265 0.3765
NOTE: Convergence criterion met.
Estimation Summary
Method Gauss-NewtonIterations 5R 3.628E-6PPC(B) 4.559E-6RPC(B) 0.000021Object 2.25E-10Objective 0.37647Observations Read 20Observations Used 20Observations Missing 0
PROC NLIN Output
Sum of Mean ApproxSource DF Squares Square F Value Pr > F
Model 3 9.6353 3.2118 145.03 <.0001Error 17 0.3765 0.0221Uncorrected Total 20 10.0117
ApproxParameter Estimate Std Error Approximate 95% Confidence Limits
I 4.6124 0.4511 3.6607 5.5640B -4.6384 1.7176 -8.2622 -1.0147C 0.2265 0.0723 0.0739 0.3791
Approximate Correlation Matrix I B C
I 1.0000000 -0.4991207 0.6394756B -0.4991207 1.0000000 -0.5126022C 0.6394756 -0.5126022 1.0000000
Sum of Mean ApproxSource DF Squares Square F Value Pr > F
Model 3 9.6353 3.2118 145.03 <.0001Error 17 0.3765 0.0221Uncorrected Total 20 10.0117
ApproxParameter Estimate Std Error Approximate 95% Confidence Limits
I 4.6124 0.4511 3.6607 5.5640B -4.6384 1.7176 -8.2622 -1.0147C 0.2265 0.0723 0.0739 0.3791
Approximate Correlation Matrix I B C
I 1.0000000 -0.4991207 0.6394756B -0.4991207 1.0000000 -0.5126022C 0.6394756 -0.5126022 1.0000000
PROC NLIN Output (cont)
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
Ln (temp)0 1 2 3
Pro
po
rtio
n A
live
PROC NLIN Output (cont)
• NLIN Limitations• Assumes normally distributed response.• Approximate tests.• Treatment comparisons not automatic.
• NLIN Advantages• Not restricted to proportional data.• Maximum may be any value.• Response models not limited.
PROC NLIN (cont)
proc nlmixed data=freeze corr; parms I = 4.5 B = -4.8 C = .228; bounds B<0, I>0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));
model alive2wk ~ binomial(plants, mu);predict plants*mu out=pred1;predict mu out=pred2;
proc nlmixed data=freeze corr; parms I = 4.5 B = -4.8 C = .228; bounds B<0, I>0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));
model alive2wk ~ binomial(plants, mu);predict plants*mu out=pred1;predict mu out=pred2;
• Code:
proc nlmixed data=freeze corr; parms I = 4.5 B = -4.8 C = .228; bounds B<0, I>0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));
model alive2wk ~ binomial(plants, mu);predict plants*mu out=pred1;predict mu out=pred2;
proc nlmixed data=freeze corr; parms I = 4.5 B = -4.8 C = .228; bounds B<0, I>0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));
model alive2wk ~ binomial(plants, mu);predict plants*mu out=pred1;predict mu out=pred2;
proc nlmixed data=freeze corr;parms I = 4.5 B = -4.8 C = .228;bounds B<0, I>0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));
model alive2wk ~ binomial(plants, mu);predict plants*mu out=pred1;
predict mu out=pred2;
proc nlmixed data=freeze corr;parms I = 4.5 B = -4.8 C = .228;bounds B<0, I>0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));
model alive2wk ~ binomial(plants, mu);predict plants*mu out=pred1;
predict mu out=pred2;
proc nlmixed data=freeze corr; parms I = 4.5 B = -4.8 C = .228; bounds B<0, I>0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));
model alive2wk ~ binomial(plants, mu);predict plants*mu out=pred1;
predict mu out=pred2;
proc nlmixed data=freeze corr; parms I = 4.5 B = -4.8 C = .228; bounds B<0, I>0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));
model alive2wk ~ binomial(plants, mu);predict plants*mu out=pred1;
predict mu out=pred2;
proc nlmixed data=freeze corr; parms I = 4.5 B = -4.8 C = .228; bounds B<0, I>0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));
model alive2wk ~ binomial(plants, mu);predict plants*mu out=pred1;
predict mu out=pred2;
proc nlmixed data=freeze corr; parms I = 4.5 B = -4.8 C = .228; bounds B<0, I>0;
mu = C + (1-C)/(1 + exp(B*(ltemp-log(I))));
model alive2wk ~ binomial(plants, mu);predict plants*mu out=pred1;
predict mu out=pred2;
Maximum Likelihood
• SAS Procedure: PROC NLMIXED
Dependent Variable alive2wkDistribution for Dependent Variable BinomialOptimization Technique Dual Quasi-Newton
Dimensions
Observations Used 20Observations Not Used 0Total Observations 20Parameters 3
Iteration History
Iter Calls NegLogLike Diff MaxGrad Slope
1 4 28.3612297 0.034097 1.623059 -27.1026 2 5 28.2115599 0.14967 0.572223 -3.97671 3 10 28.1847135 1.433E-8 0.000016 -2.67E-8
NOTE: GCONV convergence criterion satisfied.
Fit Statistics
-2 Log Likelihood 56.4 AIC (smaller is better) 62.4 AICC (smaller is better) 63.9 BIC (smaller is better) 65.4
Dependent Variable alive2wkDistribution for Dependent Variable BinomialOptimization Technique Dual Quasi-Newton
Dimensions
Observations Used 20Observations Not Used 0Total Observations 20Parameters 3
Iteration History
Iter Calls NegLogLike Diff MaxGrad Slope
1 4 28.3612297 0.034097 1.623059 -27.1026 2 5 28.2115599 0.14967 0.572223 -3.97671 3 10 28.1847135 1.433E-8 0.000016 -2.67E-8
NOTE: GCONV convergence criterion satisfied.
Fit Statistics
-2 Log Likelihood 56.4 AIC (smaller is better) 62.4 AICC (smaller is better) 63.9 BIC (smaller is better) 65.4
PROC NLMIXED Output
PROC NLMIXED Output (cont)
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper Gradient
I 4.6337 0.4151 20 11.16 <.0001 0.05 3.7677 5.4996 4.629E-6B -4.5094 1.1543 20 -3.91 0.0009 0.05 -6.9172 -2.1016 -2.62E-6C 0.2258 0.06231 20 3.62 0.0017 0.05 0.09585 0.3558 0.000016
Correlation Matrix of Parameter Estimates
Row Parameter I B C
1 I 1.0000 -0.5276 0.5848 2 B -0.5276 1.0000 -0.3896 3 C 0.5848 -0.3896 1.0000
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper Gradient
I 4.6337 0.4151 20 11.16 <.0001 0.05 3.7677 5.4996 4.629E-6B -4.5094 1.1543 20 -3.91 0.0009 0.05 -6.9172 -2.1016 -2.62E-6C 0.2258 0.06231 20 3.62 0.0017 0.05 0.09585 0.3558 0.000016
Correlation Matrix of Parameter Estimates
Row Parameter I B C
1 I 1.0000 -0.5276 0.5848 2 B -0.5276 1.0000 -0.3896 3 C 0.5848 -0.3896 1.0000
1
2
3
4
5
6
7
8
9
10
Ln(temp)0 1 2 3
Nu
mb
er
of
surv
ivin
g p
lan
tsPROC NLMIXED Output (cont)
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
Ln(temp)0 1 2 3
Procedure Comparisons
Probit
NLin
NLMixedPro
po
rtio
n A
live
• All three procedures can produce similar results.• Binomial or proportional data.• Maximum response of 1.0.
• PROBIT limited in models and response types.
• NLIN and NLMIXED provide nonlinear solutions.
• NLMIXED most flexible for responses and models.
Procedure Comparisons
NLMIXED Example: Normal Data
• Binomial - yes/no data.
• Normal - continuous data.
• Poisson - discrete count data.
• User defined - any data.
• NLMIXED probability distributions:
• Example: Seefeldt, et al. 1995
• Wild oat resistance• Treated with fenoxaprop/2,4-D/MCPA (SAS: dose).• Dry weights at 2 weeks (SAS: adj_wt).
0.00
0.02
0.04
0.06
0.08
0.10
0.12
0.14
0.16
0.18
0.20
0.22
0.24
0.26
0.28
Dry
Wei
gh
t (g
)NLMIXED Example: Normal Data
Biotype C
0.010 0.100 1.000 10.000
Dose (kg ai/ha)
proc nlmixed data=seefeldt;parms C=.04 D=.2 B=3 I=.1 sig=.021;bounds C>0, D>0, B>0, sig>0;
if dose = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ldose-log(I))));model adj_wt ~ normal(mu, sig**2);predict mu out=fitted;
proc nlmixed data=seefeldt;parms C=.04 D=.2 B=3 I=.1 sig=.021;bounds C>0, D>0, B>0, sig>0;
if dose = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ldose-log(I))));model adj_wt ~ normal(mu, sig**2);predict mu out=fitted;
• Assume dry weight to be normally distributed with mean mu and variance sig2.
• Must model sig explicitly.
NLMIXED Example: Normal Data
Iteration History
Iter Calls NegLogLike Diff MaxGrad Slope
1 14 -63.769085 17.90341 925.7938 -4745664 2 19 -90.116746 26.34766 3490.083 -1912.68 3 66 -122.58572 4.511E-8 0.040557 -1E-7
NOTE: GCONV convergence criterion satisfied.
Fit Statistics
-2 Log Likelihood -245.2AIC (smaller is better) -235.2AICC (smaller is better) -233.9BIC (smaller is better) -225.1
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Lower Upper C 0.04823 0.01893 51 2.55 0.0137 0.01030 0.08616 D 0.1836 0.00794 51 23.12 <.0001 0.1677 0.1996 B 1.3283 0.4510 51 2.95 0.0047 0.4246 2.2321 I 1.1669 0.3539 51 3.30 0.0017 0.4576 1.8762 sig 0.02937 0.00280 51 10.49 <.0001 0.02376 0.03498
Iteration History
Iter Calls NegLogLike Diff MaxGrad Slope
1 14 -63.769085 17.90341 925.7938 -4745664 2 19 -90.116746 26.34766 3490.083 -1912.68 3 66 -122.58572 4.511E-8 0.040557 -1E-7
NOTE: GCONV convergence criterion satisfied.
Fit Statistics
-2 Log Likelihood -245.2AIC (smaller is better) -235.2AICC (smaller is better) -233.9BIC (smaller is better) -225.1
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Lower Upper C 0.04823 0.01893 51 2.55 0.0137 0.01030 0.08616 D 0.1836 0.00794 51 23.12 <.0001 0.1677 0.1996 B 1.3283 0.4510 51 2.95 0.0047 0.4246 2.2321 I 1.1669 0.3539 51 3.30 0.0017 0.4576 1.8762 sig 0.02937 0.00280 51 10.49 <.0001 0.02376 0.03498
NLMIXED Example: Normal Data
Dry
Wei
gh
t (g
)
0.00
0.02
0.04
0.06
0.08
0.10
0.12
0.14
0.16
0.18
0.20
0.22
0.24
0.26
0.28
NLMIXED Example: Normal Data
0.010 0.100 1.000 10.000
Dose (kg ai/ha)
Biotype C
NLMIXED: Extension of Log-logistic Model
• The log-logistic model can be generalized to estimate any percentile as (Schabenberger, 1999):
yij = C + k(D - C) / (k + exp(B( dosei – I(1-Q) )))
where I(1-Q) is the dose required to reachthe Qth percentile, and k is given by :
k = Q/(1 - Q)
NLMIXED: Extension of Log-logistic Model
• Example: • Seefeldt data, biotype C.• Estimate the 90th percentile, e.g. I10
k = Q/(1 - Q) = 0.9/(1.0 - 0.9) = 9.0
Q = 0.9
NLMIXED: Extension of Log-logistic Model
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
C 0.04823 0.01893 51 2.55 0.0136 0.05 0.01030 0.08616 D 0.1836 0.007942 51 23.12 <.0001 0.05 0.1677 0.1996 B 1.3284 0.4510 51 2.95 0.0047 0.05 0.4246 2.2321 I 0.2214 0.1098 51 2.02 0.0487 0.05 0.00134 0.4415 sig 0.02605 0.002484 51 10.49 <.0001 0.05 0.02107 0.03103
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
C 0.04823 0.01893 51 2.55 0.0136 0.05 0.01030 0.08616 D 0.1836 0.007942 51 23.12 <.0001 0.05 0.1677 0.1996 B 1.3284 0.4510 51 2.95 0.0047 0.05 0.4246 2.2321 I 0.2214 0.1098 51 2.02 0.0487 0.05 0.00134 0.4415 sig 0.02605 0.002484 51 10.49 <.0001 0.05 0.02107 0.03103
proc nlmixed data=seefeldt;parms C=.04 D=.2 B=3 I=.1 sig=.021;bounds C>0, D>0, B>0, sig>0;k = 9.0;if dose = 0 then mu = d;else mu = C + k*(D-C)/(k + exp(B*(ldose-log(I))));model adj_wt ~ normal(mu, sig**2);
proc nlmixed data=seefeldt;parms C=.04 D=.2 B=3 I=.1 sig=.021;bounds C>0, D>0, B>0, sig>0;k = 9.0;if dose = 0 then mu = d;else mu = C + k*(D-C)/(k + exp(B*(ldose-log(I))));model adj_wt ~ normal(mu, sig**2);
0.00
0.02
0.04
0.06
0.08
0.10
0.12
0.14
0.16
0.18
0.20
0.22
0.24
0.26
0.28
Dry
Wei
gh
t (g
)
0.010 0.100 1.000 10.000
Dose (kg ai/ha)
I10I50
NLMIXED: Extension of Log-logistic Model
Biotype C
NLMIXED Example: Treatment Structure
• SAS Data Step statements.
• Build full model.
• Estimates pooled or heterogeneous error.
• Estimate and Contrast statements for treatment
comparisons.
• NLMIXED can accommodate treatment structure:
• Example: Seefeldt, et al. 1995
• Wild oat resistance to fenoxaprop (SAS: dose).• Dry weights at 2 weeks (SAS: adj_wt).• Three biotypes ; w, b, and c (SAS: biotype).
• Specify a full model with:
• Independent parameters B and I for each
biotype.
• Common parameter values for C, D, and sig.
Wt = C + (D - C) / (1 + exp(B(dosei - I)))
where B and I are dependent on biotype.
NLMIXED Example: Treatment Structure
proc nlmixed data=seefeldt;parms C=.02757 D=.1734 Iw=.1188 Ib=.2221 Ic=1.8936
Bw=4.9642 Bb=2.9461 Bc=1.223 sig=.021;
bounds C>0, D>0, Bc>0, Bw>0, Bb>0, sig>0;
if biotype = ’w' then do; I = Iw; B=Bw;
end;else if biotype = 'c' then do;
I = Ic; B=Bc; end;else if biotype = 'b' then do;
I = Ib; B=Bb; end;
if dose = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ldose-log(I)))); model adj_wt ~ normal(mu, sig**2);
contrast 'Iw vs Ic' Iw-Ic;contrast 'Iw vs Ib' Iw-Ib;contrast 'Ib vs Ic' Ib-Ic;predict mu out=fitted;
proc nlmixed data=seefeldt;parms C=.02757 D=.1734 Iw=.1188 Ib=.2221 Ic=1.8936
Bw=4.9642 Bb=2.9461 Bc=1.223 sig=.021;
bounds C>0, D>0, Bc>0, Bw>0, Bb>0, sig>0;
if biotype = ’w' then do; I = Iw; B=Bw;
end;else if biotype = 'c' then do;
I = Ic; B=Bc; end;else if biotype = 'b' then do;
I = Ib; B=Bb; end;
if dose = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ldose-log(I)))); model adj_wt ~ normal(mu, sig**2);
contrast 'Iw vs Ic' Iw-Ic;contrast 'Iw vs Ib' Iw-Ib;contrast 'Ib vs Ic' Ib-Ic;predict mu out=fitted;
proc nlmixed data=seefeldt;parms C=.02757 D=.1734 Iw=.1188 Ib=.2221 Ic=1.8936
Bw=4.9642 Bb=2.9461 Bc=1.223 sig=.021;
bounds C>0, D>0, Bc>0, Bw>0, Bb>0, sig>0;
if biotype = ’w' then do; I = Iw; B=Bw;
end;else if biotype = 'c' then do;
I = Ic; B=Bc; end;else if biotype = 'b' then do;
I = Ib; B=Bb; end;
if dose = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ldose-log(I))));model adj_wt ~ normal(mu, sig**2);
contrast 'Iw vs Ic' Iw-Ic;contrast 'Iw vs Ib' Iw-Ib;contrast 'Ib vs Ic' Ib-Ic;predict mu out=fitted;
proc nlmixed data=seefeldt;parms C=.02757 D=.1734 Iw=.1188 Ib=.2221 Ic=1.8936
Bw=4.9642 Bb=2.9461 Bc=1.223 sig=.021;
bounds C>0, D>0, Bc>0, Bw>0, Bb>0, sig>0;
if biotype = ’w' then do; I = Iw; B=Bw;
end;else if biotype = 'c' then do;
I = Ic; B=Bc; end;else if biotype = 'b' then do;
I = Ib; B=Bb; end;
if dose = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ldose-log(I))));model adj_wt ~ normal(mu, sig**2);
contrast 'Iw vs Ic' Iw-Ic;contrast 'Iw vs Ib' Iw-Ib;contrast 'Ib vs Ic' Ib-Ic;predict mu out=fitted;
proc nlmixed data=seefeldt;parms C=.02757 D=.1734 Iw=.1188 Ib=.2221 Ic=1.8936
Bw=4.9642 Bb=2.9461 Bc=1.223 sig=.021;
bounds C>0, D>0, Bc>0, Bw>0, Bb>0, sig>0;
if biotype = ’w' then do; I = Iw; B=Bw;
end;else if biotype = 'c' then do;
I = Ic; B=Bc; end;else if biotype = 'b' then do;
I = Ib; B=Bb; end;
if dose = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ldose-log(I))));model adj_wt ~ normal(mu, sig**2);
contrast 'Iw vs Ic' Iw-Ic;contrast 'Iw vs Ib' Iw-Ib;contrast 'Ib vs Ic' Ib-Ic;predict mu out=fitted;
proc nlmixed data=seefeldt;parms C=.02757 D=.1734 Iw=.1188 Ib=.2221 Ic=1.8936
Bw=4.9642 Bb=2.9461 Bc=1.223 sig=.021;
bounds C>0, D>0, Bc>0, Bw>0, Bb>0, sig>0;
if biotype = ’w' then do; I = Iw; B=Bw;
end;else if biotype = 'c' then do;
I = Ic; B=Bc; end;else if biotype = 'b' then do;
I = Ib; B=Bb; end;
if dose = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ldose-log(I))));model adj_wt ~ normal(mu, sig**2);
contrast 'Iw vs Ic' Iw-Ic;contrast 'Iw vs Ib' Iw-Ib;contrast 'Ib vs Ic' Ib-Ic;predict mu out=fitted;
NLMIXED Example: Treatment Structure
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
C 0.02757 0.003604 156 7.65 <.0001 0.05 0.02045 0.03469D 0.1734 0.004979 156 34.82 <.0001 0.05 0.1635 0.1832Iw 0.1188 0.01605 156 7.40 <.0001 0.05 0.08710 0.1505Ib 0.2221 0.01863 156 11.92 <.0001 0.05 0.1853 0.2589Ic 1.8937 0.3140 156 6.03 <.0001 0.05 1.2736 2.5139 Bw 4.9642 1.3211 156 3.76 0.0002 0.05 2.3548 7.5737 Bb 2.9461 1.1567 156 2.55 0.0118 0.05 0.6613 5.2309 Bc 1.2230 0.2016 156 6.07 <.0001 0.05 0.8248 1.6213 sig 0.02626 0.001450 156 18.11 <.0001 0.05 0.02339 0.02912
Contrasts
Num Den Label DF DF F Value Pr > F
Iw vs Ic 1 156 32.64 <.0001 Iw vs Ib 1 156 21.25 <.0001 Ib vs Ic 1 156 28.98 <.0001
Bw vs Bc 1 156 8.27 0.0046 Bw vs Bb 1 156 1.63 0.2030 Bb vs Bc 1 156 2.32 0.1300
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
C 0.02757 0.003604 156 7.65 <.0001 0.05 0.02045 0.03469D 0.1734 0.004979 156 34.82 <.0001 0.05 0.1635 0.1832Iw 0.1188 0.01605 156 7.40 <.0001 0.05 0.08710 0.1505Ib 0.2221 0.01863 156 11.92 <.0001 0.05 0.1853 0.2589Ic 1.8937 0.3140 156 6.03 <.0001 0.05 1.2736 2.5139 Bw 4.9642 1.3211 156 3.76 0.0002 0.05 2.3548 7.5737 Bb 2.9461 1.1567 156 2.55 0.0118 0.05 0.6613 5.2309 Bc 1.2230 0.2016 156 6.07 <.0001 0.05 0.8248 1.6213 sig 0.02626 0.001450 156 18.11 <.0001 0.05 0.02339 0.02912
Contrasts
Num Den Label DF DF F Value Pr > F
Iw vs Ic 1 156 32.64 <.0001 Iw vs Ib 1 156 21.25 <.0001 Ib vs Ic 1 156 28.98 <.0001
Bw vs Bc 1 156 8.27 0.0046 Bw vs Bb 1 156 1.63 0.2030 Bb vs Bc 1 156 2.32 0.1300
NLMIXED Example: Treatment Structure
Biotype
bcw
Pre
dic
ted
wei
gh
t (g
)
0.02
0.04
0.06
0.08
0.10
0.12
0.14
0.16
0.18
NLMIXED Example: Treatment Structure
0.010 0.100 1.000 10.000
Dose (kg ai/ha)
NLMIXED Example: Poisson data
• Data description
• Simulated injury study.
• Harmony sprayed on pea plants.• measured the number of branches/plant.• (SAS: branches).
• Ten doses:• 0 to 0.125 lbs ai/A.• (SAS: trt).
Nu
mb
er o
f B
ran
ches
0
10
20
30
40
50
60
70
80
90
100
NLMIXED Example: Poisson data
0.0001 0.0010 0.0100 0.1000 1.0000
Harmony Dose (lb ai/A)
Variety C
proc nlmixed data=pea; parms D=10 C=70 B=.8254 I=.01; bounds D>0, B>0;
if trt = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ltrt-log(I))));
model branches ~ poisson(mu);
predict mu out=pred;
proc nlmixed data=pea; parms D=10 C=70 B=.8254 I=.01; bounds D>0, B>0;
if trt = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ltrt-log(I))));
model branches ~ poisson(mu);
predict mu out=pred;
• Assume the number of branches to be distributed as a Poisson variable.
• In the Poisson distribution, mean = variance = mu.
NLMIXED Example: Poisson data
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
C 11.6834 1.0136 38 11.53 <.0001 0.05 9.6315 13.7352 I 0.01075 0.0013 38 8.41 <.0001 0.05 0.0081 0.0133 B 1.9860 0.3246 38 6.12 <.0001 0.05 1.3289 2.6432 D 69.1586 3.3894 38 20.40 <.0001 0.05 62.2972 76.0201
NLMIXED Example: Poisson data
0
10
20
30
40
50
60
70
80
90
100
Nu
mb
er o
f B
ran
ches
NLMIXED Example: Poisson data
0.0001 0.0010 0.0100 0.1000 1.0000
Variety C
Harmony Dose (lb ai/A)
NLMIXED: Alternative Models
yij = C + (D - C) / (1 + exp(B(dosei - I)))
• Log-logistic Model
yij = (a-c) exp(-bdose) + c
• Exponential Model
Example:
Exponential Model for Pea Biomass
• A linear pattern of data on a log scale.• Implies an exponential model, e.g.
Biomass = (a-c) exp(-bdose) + c
where a is an intercept term, c is a lower limit and b is a rate parameter.
• The 50th percentile for this model is given by:
I50 = ln(((a/2) - c)/(a - c))/(-b)
NLMIXED: Alternative Models
• Example: Pea Data
• Fit log-logistic model to biomass measurements.
proc nlmixed data=pea corr maxiter=2000; parms D=.5966 I=0.01 B=.51 C=.04 sig=.09; bounds D>0, B>0;
if trt = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ltrt-log(I))));
model bio ~ normal(mu, sig**2);
proc nlmixed data=pea corr maxiter=2000; parms D=.5966 I=0.01 B=.51 C=.04 sig=.09; bounds D>0, B>0;
if trt = 0 then mu = D;else mu = C + (D-C)/(1 + exp(B*(ltrt-log(I))));
model bio ~ normal(mu, sig**2);
Bio
ma
ss
(g/p
lan
t)
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.0001 0.0010 0.0100 0.1000
Log-logistic Model for Pea Biomass
Harmony Dose (lb ai/A)
Log-logistic Model for Pea Biomass
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
D 1.2751 4.3499 38 0.29 0.7710 0.05 -7.5308 10.0810 I 0.02792 0.4771 38 0.06 0.9536 0.05 -0.9379 0.9937 B 0.1261 0.6405 38 0.20 0.8449 0.05 -1.1704 1.4227 C -0.7546 5.9311 38 -0.13 0.8994 0.05 -12.7614 11.2522 sig 0.09240 0.01060 38 8.72 <.0001 0.05 0.07094 0.1139
Correlation Matrix of Parameter Estimates
Row Parameter D I B C sig
1 D 1.0000 0.6108 -0.9903 -0.9568 -0.00074 2 I 0.6108 1.0000 -0.7133 -0.8146 -0.00306 3 B -0.9903 -0.7133 1.0000 0.9873 0.001188 4 C -0.9568 -0.8146 0.9873 1.0000 0.001668 5 sig -0.00074 -0.00306 0.001188 0.001668 1.0000
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
D 1.2751 4.3499 38 0.29 0.7710 0.05 -7.5308 10.0810 I 0.02792 0.4771 38 0.06 0.9536 0.05 -0.9379 0.9937 B 0.1261 0.6405 38 0.20 0.8449 0.05 -1.1704 1.4227 C -0.7546 5.9311 38 -0.13 0.8994 0.05 -12.7614 11.2522 sig 0.09240 0.01060 38 8.72 <.0001 0.05 0.07094 0.1139
Correlation Matrix of Parameter Estimates
Row Parameter D I B C sig
1 D 1.0000 0.6108 -0.9903 -0.9568 -0.00074 2 I 0.6108 1.0000 -0.7133 -0.8146 -0.00306 3 B -0.9903 -0.7133 1.0000 0.9873 0.001188 4 C -0.9568 -0.8146 0.9873 1.0000 0.001668 5 sig -0.00074 -0.00306 0.001188 0.001668 1.0000
Exponential Model for Pea Biomass
proc nlmixed data=pea corr; parms a=.5217 b=106.5 c = .2026 sig=.09;
mu =(a-c)*exp(-b*trt) + c;
model bio ~ normal(mu, sig**2);predict mu out=pred;
estimate ’I50' log(((a/2)-c)/(a-c))/(-b);
proc nlmixed data=pea corr; parms a=.5217 b=106.5 c = .2026 sig=.09;
mu =(a-c)*exp(-b*trt) + c;
model bio ~ normal(mu, sig**2);predict mu out=pred;
estimate ’I50' log(((a/2)-c)/(a-c))/(-b);
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
a 0.5260 0.03375 38 15.59 <.0001 0.05 0.4577 0.5943 b 106.50 51.3184 38 2.08 0.0448 0.05 2.6113 210.39 c 0.2026 0.03622 38 5.59 <.0001 0.05 0.1293 0.2760 sig 0.09861 0.01131 38 8.72 <.0001 0.05 0.07571 0.1215
Correlation Matrix of Parameter Estimates
Row Parameter a b c sig
1 a 1.0000 0.6473 0.2864 0.000060 2 b 0.6473 1.0000 0.6696 0.000091 3 c 0.2864 0.6696 1.0000 0.000062 4 sig 0.000060 0.000091 0.000062 1.0000
Additional Estimates
StandardLabel Estimate Error DF t Value Pr > |t| Alpha Lower Upper
I50 0.01576 0.006829 38 2.31 0.0265 0.05 0.001937 0.02958
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
a 0.5260 0.03375 38 15.59 <.0001 0.05 0.4577 0.5943 b 106.50 51.3184 38 2.08 0.0448 0.05 2.6113 210.39 c 0.2026 0.03622 38 5.59 <.0001 0.05 0.1293 0.2760 sig 0.09861 0.01131 38 8.72 <.0001 0.05 0.07571 0.1215
Correlation Matrix of Parameter Estimates
Row Parameter a b c sig
1 a 1.0000 0.6473 0.2864 0.000060 2 b 0.6473 1.0000 0.6696 0.000091 3 c 0.2864 0.6696 1.0000 0.000062 4 sig 0.000060 0.000091 0.000062 1.0000
Additional Estimates
StandardLabel Estimate Error DF t Value Pr > |t| Alpha Lower Upper
I50 0.01576 0.006829 38 2.31 0.0265 0.05 0.001937 0.02958
Exponential Model for Pea Biomass
Exponential Model for Pea Biomass
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.0001 0.0010 0.0100 0.1000
Bio
ma
ss
(g/p
lan
t)
Harmony Dose (lb ai/A)
Nonlinear Mixed Models
• Random effects may also be modeled.• Locations.• Years.• Experiments/replications.• See for example Nielson, et al 2004.
• Components estimated.• Within effects - Variances.• Between effects - Covariances.
• Requires caution.• Parsimony.• Estimation problems.
• Example: Fungus Gnat Data.
• Evaluate efficacy of rapeseed meal (SAS: dose).
• Three experiments.
• Separate runs for each block (SAS: block).
• Measured egg hatch (SAS: mort).
• High variability in natural mortality from
run to run.
Nonlinear Mixed Models
proc nlmixed maxiter=1000 data=gnat2; parms I=.245 B=-3.58 c=.295; bounds B<0, C>0, I>0;
if dose = 0 then mu = c;else mu = c + (1-c)/(1 + exp(B*(ldose-log(I))));model mort ~ binomial(20,mu);
predict mu*20 out=pred1;run;
proc nlmixed maxiter=1000 data=gnat2; parms I=.245 B=-3.58 c=.295; bounds B<0, C>0, I>0;
if dose = 0 then mu = c;else mu = c + (1-c)/(1 + exp(B*(ldose-log(I))));model mort ~ binomial(20,mu);
predict mu*20 out=pred1;run;
Nonlinear Mixed Models
• Fixed effects model:
Fit Statistics
-2 Log Likelihood 1593.6 AIC (smaller is better) 1599.6 AICC (smaller is better) 1599.8 BIC (smaller is better) 1609.5
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
I 0.2387 0.01117 200 21.38 <.0001 0.05 0.2167 0.2607B -1.6369 0.1708 200 -9.59 <.0001 0.05 -1.9736 -1.3002c 0.2567 0.01610 200 15.94 <.0001 0.05 0.2249 0.2884
Fit Statistics
-2 Log Likelihood 1593.6 AIC (smaller is better) 1599.6 AICC (smaller is better) 1599.8 BIC (smaller is better) 1609.5
Parameter Estimates
StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
I 0.2387 0.01117 200 21.38 <.0001 0.05 0.2167 0.2607B -1.6369 0.1708 200 -9.59 <.0001 0.05 -1.9736 -1.3002c 0.2567 0.01610 200 15.94 <.0001 0.05 0.2249 0.2884
Nonlinear Mixed Models
• Fixed effects model:
Mo
rta l
ity
0
10
20
Rapeseed Meal (mg)0.01 0.10
Fixed Effects Model
Nonlinear Mixed Models
• Random effects model:• Let natural mortality parameter, C, be random.
proc nlmixed maxiter=1000 data=gnat2; parms I=.2582 B=-1.78 C=.2866 sigC=.17; bounds B<0, c>0, I>0;
Ce = C + e;
if dose = 0 then mu = Ce;else mu = Ce + (1-Ce)/(1 + exp(B*(ldose-log(I))));model mort ~ binomial(20,mu);
random e~normal(0, sigC**2) subject=block;
proc nlmixed maxiter=1000 data=gnat2; parms I=.2582 B=-1.78 C=.2866 sigC=.17; bounds B<0, c>0, I>0;
Ce = C + e;
if dose = 0 then mu = Ce;else mu = Ce + (1-Ce)/(1 + exp(B*(ldose-log(I))));model mort ~ binomial(20,mu);
random e~normal(0, sigC**2) subject=block;
Fit Statistics -2 Log Likelihood 1182.9 AIC (smaller is better) 1190.9 AICC (smaller is better) 1191.1 BIC (smaller is better) 1192.1
Parameter Estimates StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
I 0.2580 0.009979 9 25.85 <.0001 0.05 0.2354 0.2805B -1.7834 0.1668 9 -10.69 <.0001 0.05 -2.1606 -1.4062C 0.2861 0.06377 9 4.49 0.0015 0.05 0.1419 0.4304sigC 0.1981 0.04511 9 4.39 0.0017 0.05 0.09609 0.3002
Fit Statistics -2 Log Likelihood 1182.9 AIC (smaller is better) 1190.9 AICC (smaller is better) 1191.1 BIC (smaller is better) 1192.1
Parameter Estimates StandardParm Estimate Error DF t Value Pr > |t| Alpha Lower Upper
I 0.2580 0.009979 9 25.85 <.0001 0.05 0.2354 0.2805B -1.7834 0.1668 9 -10.69 <.0001 0.05 -2.1606 -1.4062C 0.2861 0.06377 9 4.49 0.0015 0.05 0.1419 0.4304sigC 0.1981 0.04511 9 4.39 0.0017 0.05 0.09609 0.3002
Nonlinear Mixed Models
• Random effects model
Mo
rta l
ity
0
10
20
Rapeseed Meal (mg)0.01 0.10
Random Effects Model
Mo
rta l
ity
0
10
20
Rapeseed Meal (mg)0.01 0.10
Random and Fixed Effects Models
Fixed Effects
Random Effects
• In general, random effects models:• Are useful with identifiable sources of variability.• Increase overall variability.• Improve measures of fit.
• However:• They may not be parsimonious.• They can be difficult to fit.
Nonlinear Mixed Models
References
• Nielson, O. K., C. Ritz, J. C. Streibig. 2004. Nonlinear mixed-model regression to analyze herbicide dose-response relationships. Weed Technonlogy, 18: 30-37.
• Ratkowsky, D. A. 1989. Handbook of Nonlinear Regression Models. Marcel Dekker, Inc. 241 pp.
• SAS Inst. Inc. 2004. SAS OnlineDoc, Version 9, Cary, NC.
• Schabenberger,O., B. E. Tharp, J. J. Kells, and D. Penner. 1999. Statistical tests for hormesis and effective dosages in herbicide dose response. Agron. J. 91: 713-721.
• Seefeldt, S.S., J. E. Jensen, and P. Fuerst. 1995. Log-logistic analysis of herbicide dose-response relationships. Weed Technol. 9:218-227.
Questions / Commentshttp://www.uidaho.edu/ag/statprog