Argument is missing, with no default

I am using the EZ2 package to estimate some parameters (v, z, a, Ter). The model fit and calculation works well for everything related to Vrt_w, Pe_w, Pe_nw, which returns me values for v, z, a. But when I added Mrt_w ~ EZ2.mrt(v, z, a, Ter) to the model and the relevant input data and command I get:

Error in EZ2.mrt(v, z, a, Ter) : 
  argument "Ter" is missing, with no default

The full entry looks like this:

> library(EZ2)

> Mrt_w ~ EZ2.mrt(v, z, a, Ter)
Mrt_w ~ EZ2.mrt(v, z, a, Ter)
> Vrt_w ~ EZ2.vrt(v, z, a)
Vrt_w ~ EZ2.vrt(v, z, a)
> Pe_w ~ EZ2.pe(v, z, a)
Pe_w ~ EZ2.pe(v, z, a)
> Pe_nw ~ EZ2.pe(v, z, a)
Pe_nw ~ EZ2.pe(v, z, a)

> Mrt_w = 0.39088
> Vrt_w = 0.00858998
> Pe_nw = 0.025
> Pe_w = 0.002083333
> EZ2(c(v=.12, z=.05, a=.14, Ter=.11), Vrt_w ~ EZ2.vrt(v,z,a), Pe_w ~ EZ2.pe(v,z,a),  Pe_nw ~ EZ2.pe(v,z,a), Mrt_w ~ EZ2.mrt(v,z,a,Ter))
Error in EZ2.mrt(v, z, a, Ter) : 
  argument "Ter" is missing, with no default

its because the parameters are being passed by position, so your Ter value goes into the s parameter you can be more explicit and do

EZ2(c(v=.12, z=.05, a=.14, Ter=.11), Vrt_w ~ EZ2.vrt(v,z,a), Pe_w ~ EZ2.pe(v,z,a),  Pe_nw ~ EZ2.pe(v,z,a), Mrt_w ~ EZ2.mrt(v,z,a,Ter=Ter))
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

This worked. Thank you!