# [R] D-optimum design - optimization model in R

Thanh Tran m@@ternh@ttt @ending from gm@il@com
Wed Dec 5 00:44:25 CET 2018

```Dear  Bert Gunter,

Thank you for your advice. I will take care in the next post.

Best regards,
Nhat Tran.

Vào Th 3, 4 thg 12, 2018 vào lúc 23:16 Bert Gunter <bgunter.4567 using gmail.com>
đã viết:

> read and follow the posting guide below, which you have not yet done. For
> example, what is "F.cube", what packages are you using? Also, this list is
> about R programming, not statistics, which is more what your query seems to
> be about. Finally, search yourself! -- e,g, "d-optimal designs" on
> rseek.org brought up what appeared to be many relevant hits, including a
> CRAN task view on experimental design.
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Tue, Dec 4, 2018 at 3:29 AM Thanh Tran <masternhattt using gmail.com> wrote:
>
>> Dear all,
>>
>>
>>
>> I'm trying to use the D-optimum design. In my data, the response is KIC,
>> and 4 factors are AC, AV, T, and Temp. A typical second-degree response
>> modeling is as follows:
>>
>>
>>
>>
>> > mod <-
>>
>> lm(KIC~AC+I(AC^2)+AV+I(AV^2)+T+I(T^2)+Temp+I(Temp^2)+AC:AV+AC:T+AC:Temp+AV:T+AV:Temp+T:Temp,
>>
>> + data = data)
>>
>>
>>
>> The result of the model:
>>
>>
>>
>> KIC = 4.85 – 2.9AC +0.151 AV + 0.1094T
>>
>>           + 0.0091Temp + 0.324 AC^2-0.0156V^2
>>
>>           - 10.00106T^2 - 0.0009Temp^2 + 0.0071AC´AV
>>
>>           - 0.00087AC´T -0.00083AC´Temp – 0.0018AV´T
>>
>>          +0.0015AV´Temp – 0.000374 AV ´ T
>>
>>
>>
>> Based on the above response modelling, I want to determine levels of the
>> AC, AV, T, and Temp to have the Maximum value of KIC. The result running
>> in
>> Minitab as is shown in Figure 1. In R, I try to compute an D-optimum
>> design
>> with the following codes:
>>
>>
>>
>> > attach(data)
>>
>> > F.trig <- F.cube
>>
>> > F.trip <-
>>
>> F.cube(KIC~AC+I(AC^2)+AV+I(AV^2)+T+I(T^2)+Temp+I(Temp^2)+AC:AV+AC:T+AC:Temp+AV:T+AV:Temp+T:Temp,
>>
>> + c(4,4,30,5), # Smalesst values of AC,AV,T, and Temp
>>
>> + c(5,7,50,25), # Highest values of AC,AV,T, and Temp
>>
>> + c(3,3,3,3)) # Numbers of levels ofAC,AV,T, and Temp
>>
>> > res.trip.D <- od.AA(F.trip,1,alg = "doom", crit = "D",
>>
>> + graph =1:7, t.max = 4)
>>
>>
>>
>> I have the result as shown in Figure 2 but I cannot find out the optimum
>> design as shown in Figure 1 using Minitab.
>>
>>
>>
>> If anyone has any experience about what would be the reason for error or
>> how I can solve it? I really appreciate your support and help.
>>
>>
>>
>> Best regards,
>>
>> Nhat Tran
>>
>>
>>
>> Ps: I also added a CSV file for practicing R.
>> ______________________________________________
>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help