1. We are not a "help desk", in the sense of being constituted by a
software provider for customer support. This is a forum of volunteers.
Not a big deal, but no guarantees and caveat emptor.
2. You may get a reply here, but there is another forum specifically
for nlme (and its successor, lme4), r-sig-mixed-models,
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models . You should
post there if you don't get useful help here.
3. I haven't used nlme in a long time, but your error message seems to
suggest some issue with your data. You *may* need to provide the
results of str(minitab) to get a useful answer (or I may simply not
recognize an obvious issue in what you provided in your post).
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 Thu, Apr 7, 2022 at 4:29 AM Rohan Richard via R-help
<r-help at r-project.org> wrote:>
> Dear Help Desk,
>
> I am trying to perform a non-linear regression (Sigmoid curves) using the R
package nlme. My field trial is a randomised complete block design (RCBD) with 3
blocks and I would like to assess the block effect in the model. Do you know how
I can incorporate the block term in nlme function?
>
> So far I tried the following code and it did not work and I an error error
message:
>
> # code
> minitab$NDVI<-as.factor(minitab$NDVI)
> modnlme1 <- nlme(NDVI ~ a + d / (1 + exp(-b * (DegreeDay - m)) ), data =
minitab,
> random =a + d + b + m~ 1|Block,
> fixed = list(a ~ Lines1, d~Lines1,b ~ Lines1, m ~ Lines1),
> weights = varPower(),
> start=c(b=0.5,c=3,d=0.4, e=700), control = list(msMaxIter
= 200))
>
> #Error message
> Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
> contrasts can be applied only to factors with 2 or more levels
>
> Could you please kindly help me?
>
> Thank you in advance,
>
> Best wishes,
>
> Rohan
>
> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for
Windows
>
>
> Rothamsted Research is a company limited by guarantee, registered in
England at Harpenden, Hertfordshire, AL5 2JQ under the registration number
2393175 and a not for profit charity number 802038.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.