error message for function: lmer (from lme4 package)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

error message for function: lmer (from lme4 package)

R help mailing list-2
Dear R Community,
My data have 3 conditions and each condition has 6 replicates. I am trying to fit my data for a linear mixed model using the lmer function from lme4 package to find the random effects of the replicates; however, I got the error message. Here are the example codes:
>example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))> example.3    levels replicate conditions1  43.1111         0         112  42.0942         1         113  57.8131         2         114  57.1726         3         115  77.8678         4         116  44.7578         5         117  69.5078         0         128  52.0581         1         129  40.0602         2         1210 45.5487         3         1211 43.6201         4         1212 60.4939         5         1213 64.1932         0         1314 53.4055         1         1315 59.6701         2         1316 52.6922         3         1317 53.8712         4         1318 60.2770         5         13> m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error: number of observations (=18) <= number of random effects (=18) for term (conditions | replicate); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable> 
Could anyone help me figure out how to fix the issue? 
Thank you very much for any inputs!
Ace

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: error message for function: lmer (from lme4 package)

David Winsemius

> On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help <[hidden email]> wrote:
>
> Dear R Community,
> My data have 3 conditions and each condition has 6 replicates. I am trying to fit my data for a linear mixed model using the lmer function from lme4 package to find the random effects of the replicates;

Better venue for this question might be SIG-mixed-models. See the link avaialble at the bottom of every posting from rhelp:

https://stat.ethz.ch/mailman/listinfo/r-help:



> however, I got the error message. Here are the example codes:
>> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))> example.3    levels replicate conditions1  43.1111         0         112  42.0942         1         113  57.8131         2         114  57.1726         3         115  77.8678         4         116  44.7578         5         117  69.5078         0         128  52.0581         1         129  40.0602         2         1210 45.5487         3         1211 43.6201         4         1212 60.4939         5         1213 64.1932         0         1314 53.4055         1         1315 59.6701         2         1316 52.6922         3         1317 53.8712         4         1318 60.2770         5         13> m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error: number of observations (=18) <= number of random effects (=18) for term (conditions | replicate); the random-effects parameters and the residual variance (o
 r scale parameter) are probably unidentifiable>
> Could anyone help me figure out how to fix the issue?
> Thank you very much for any inputs!
> Ace
>
> [[alternative HTML version deleted]]

Complete mess. If you haven't yet been advised to posting in plain text, then this should be your wakeup call. If you have, then why are you ignoring sensible advice?


>
> ______________________________________________
> [hidden email] 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.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: error message for function: lmer (from lme4 package)

R help mailing list-2
Hi, David,
Thank you very much for getting back to me! Sorry about the messy code example. I am re-posting here (including the error message):
> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))> example.3    levels replicate conditions1  43.1111         0         112  42.0942         1         113  57.8131         2         114  57.1726         3         115  77.8678         4         116  44.7578         5         117  69.5078         0         128  52.0581         1         129  40.0602         2         1210 45.5487         3         1211 43.6201         4         1212 60.4939         5         1213 64.1932         0         1314 53.4055         1         1315 59.6701         2         1316 52.6922         3         1317 53.8712         4         1318 60.2770         5         13> m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error: number of observations (=18) <= number of random effects (=18) for term (conditions | replicate); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable> 
Please let me know if it is readable this time. 
Again, many thanks for your time and please help me fix the issue.
Kind regards,
Ace

    On Tuesday, November 14, 2017 12:19 PM, David Winsemius <[hidden email]> wrote:
 

 
> On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help <[hidden email]> wrote:
>
> Dear R Community,
> My data have 3 conditions and each condition has 6 replicates. I am trying to fit my data for a linear mixed model using the lmer function from lme4 package to find the random effects of the replicates;

Better venue for this question might be SIG-mixed-models. See the link avaialble at the bottom of every posting from rhelp:

https://stat.ethz.ch/mailman/listinfo/r-help:



> however, I got the error message. Here are the example codes:
>> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))> example.3    levels replicate conditions1  43.1111        0        112  42.0942        1        113  57.8131        2        114  57.1726        3        115  77.8678        4        116  44.7578        5        117  69.5078        0        128  52.0581        1        129  40.0602        2        1210 45.5487        3        1211 43.6201        4        1212 60.4939        5        1213 64.1932        0        1314 53.4055        1        1315 59.6701        2        1316 52.6922        3        1317 53.8712        4        1318 60.2770        5        13> m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error: number of observations (=18) <= number of random effects (=18) for term (conditions | replicate); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable>
> Could anyone help me figure out how to fix the issue?
> Thank you very much for any inputs!
> Ace
>
>     [[alternative HTML version deleted]]

Complete mess. If you haven't yet been advised to posting in plain text, then this should be your wakeup call. If you have, then why are you ignoring sensible advice?


>
> ______________________________________________
> [hidden email] 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.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'  -Gehm's Corollary to Clarke's Third Law






   
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: error message for function: lmer (from lme4 package)

Bert Gunter-2
Still a complete mess!

Post in **plain text**. This should be an option in your email software.
Please seek local help if you cannot figure out how to do this.

-- Bert



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, Nov 14, 2017 at 12:49 PM, Fix Ace via R-help <[hidden email]>
wrote:

> Hi, David,
> Thank you very much for getting back to me! Sorry about the messy code
> example. I am re-posting here (including the error message):
> > example.3=data.frame(levels=as.numeric(XXX[,c(4)]),
> replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(
> rep("11",6),rep("12",6),rep("13",6)))> example.3    levels replicate
> conditions1  43.1111         0         112  42.0942         1         113
> 57.8131         2         114  57.1726         3         115  77.8678
>   4         116  44.7578         5         117  69.5078         0
> 128  52.0581         1         129  40.0602         2         1210 45.5487
>         3         1211 43.6201         4         1212 60.4939         5
>     1213 64.1932         0         1314 53.4055         1         1315
> 59.6701         2         1316 52.6922         3         1317 53.8712
>   4         1318 60.2770         5         13> m.example.3=lmer(as.numeric(
> levels)~conditions+(conditions|replicate),data=example.3)Error: number of
> observations (=18) <= number of random effects (=18) for term (conditions |
> replicate); the random-effects parameters and the residual variance (or
> scale parameter) are probably unidentifiable>
> Please let me know if it is readable this time.
> Again, many thanks for your time and please help me fix the issue.
> Kind regards,
> Ace
>
>     On Tuesday, November 14, 2017 12:19 PM, David Winsemius <
> [hidden email]> wrote:
>
>
>
> > On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help <[hidden email]>
> wrote:
> >
> > Dear R Community,
> > My data have 3 conditions and each condition has 6 replicates. I am
> trying to fit my data for a linear mixed model using the lmer function from
> lme4 package to find the random effects of the replicates;
>
> Better venue for this question might be SIG-mixed-models. See the link
> avaialble at the bottom of every posting from rhelp:
>
> https://stat.ethz.ch/mailman/listinfo/r-help:
>
>
>
> > however, I got the error message. Here are the example codes:
> >> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),
> replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(
> rep("11",6),rep("12",6),rep("13",6)))> example.3    levels replicate
> conditions1  43.1111        0        112  42.0942        1        113
> 57.8131        2        114  57.1726        3        115  77.8678        4
>       116  44.7578        5        117  69.5078        0        128
> 52.0581        1        129  40.0602        2        1210 45.5487        3
>       1211 43.6201        4        1212 60.4939        5        1213
> 64.1932        0        1314 53.4055        1        1315 59.6701        2
>       1316 52.6922        3        1317 53.8712        4        1318
> 60.2770        5        13> m.example.3=lmer(as.numeric(
> levels)~conditions+(conditions|replicate),data=example.3)Error: number of
> observations (=18) <= number of random effects (=18) for term (conditions |
> replicate); the random-effects parameters and the residual variance (or
> scale parameter) are probably unidentifiable>
> > Could anyone help me figure out how to fix the issue?
> > Thank you very much for any inputs!
> > Ace
> >
> >     [[alternative HTML version deleted]]
>
> Complete mess. If you haven't yet been advised to posting in plain text,
> then this should be your wakeup call. If you have, then why are you
> ignoring sensible advice?
>
>
> >
> > ______________________________________________
> > [hidden email] 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.
>
> David Winsemius
> Alameda, CA, USA
>
> 'Any technology distinguishable from magic is insufficiently advanced.'
> -Gehm's Corollary to Clarke's Third Law
>
>
>
>
>
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: error message for function: lmer (from lme4 package)

David Winsemius
In reply to this post by R help mailing list-2

> On Nov 14, 2017, at 12:49 PM, Fix Ace <[hidden email]> wrote:
>
> Hi, David,
>
> Thank you very much for getting back to me! Sorry about the messy code example. I am re-posting here (including the error message):
>
> > example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))
> > example.3
>     levels replicate conditions
> 1  43.1111         0         11
> 2  42.0942         1         11
> 3  57.8131         2         11
> 4  57.1726         3         11
> 5  77.8678         4         11
> 6  44.7578         5         11
> 7  69.5078         0         12
> 8  52.0581         1         12
> 9  40.0602         2         12
> 10 45.5487         3         12
> 11 43.6201         4         12
> 12 60.4939         5         12
> 13 64.1932         0         13
> 14 53.4055         1         13
> 15 59.6701         2         13
> 16 52.6922         3         13
> 17 53.8712         4         13
> 18 60.2770         5         13
> > m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)
> Error: number of observations (=18) <= number of random effects (=18) for term (conditions | replicate); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable

The error message seems fairly clear. The formula you have provided is asking for estimation of too many parameters. I think you probably want:

m.example.3=lmer(levels~conditions+(1|replicate),data=example.3)

... although your description of the hypothesis under test is ... non-existent.

--
David.

> >
>
> Please let me know if it is readable this time.
>
> Again, many thanks for your time and please help me fix the issue.
>
> Kind regards,
>
> Ace
>
>
> On Tuesday, November 14, 2017 12:19 PM, David Winsemius <[hidden email]> wrote:
>
>
>
> > On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help <[hidden email]> wrote:
> >
> > Dear R Community,
> > My data have 3 conditions and each condition has 6 replicates. I am trying to fit my data for a linear mixed model using the lmer function from lme4 package to find the random effects of the replicates;
>
> Better venue for this question might be SIG-mixed-models. See the link avaialble at the bottom of every posting from rhelp:
>
> https://stat.ethz.ch/mailman/listinfo/r-help:
>
>
>
>
> > however, I got the error message. Here are the example codes:
> >> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))> example.3    levels replicate conditions1  43.1111        0         112  42.0942        1        113  57.8131        2        114  57.1726        3        115  77.8678        4        116  44.7578        5        117  69.5078        0        128  52.0581        1        129  40.0602        2        1210 45.5487        3        1211 43.6201        4        1212 60.4939        5        1213 64.1932        0        1314 53.4055        1        1315 59.6701        2        1316 52.6922        3        1317 53.8712        4        1318 60.2770        5        13> m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error: number of observations (=18) <= number of random effects (=18) for term (conditions | replicate); the random-effects parameters and the residual variance (or scale parameter) are probably u
 nidentifiable>

> > Could anyone help me figure out how to fix the issue?
> > Thank you very much for any inputs!
> > Ace
>
> >
> >     [[alternative HTML version deleted]]
>
> Complete mess. If you haven't yet been advised to posting in plain text, then this should be your wakeup call. If you have, then why are you ignoring sensible advice?
>
>
> >
> > ______________________________________________
> > [hidden email] 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.
>
> David Winsemius
> Alameda, CA, USA
>
> 'Any technology distinguishable from magic is insufficiently advanced.'  -Gehm's Corollary to Clarke's Third Law
>
>
>
>
>
>
>

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: error message for function: lmer (from lme4 package)

Bert Gunter-2
In reply to this post by Bert Gunter-2
Always cc the list, which I have done here. I am not a (free) private
consultant, nor do I have all the answers.

Based on what you sent me, which is not what you have previously posted,
you failed to load the lme3 package. See ?library.

As for the appropriateness of your modeling, you should do what David
already suggested and post to the r-sig-mixed-models list instead.

-- Bert



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 Wed, Nov 15, 2017 at 5:09 AM, Fix Ace <[hidden email]> wrote:

> Hi, Bert,
>
> Sorry about that! David seemed to be able to read the post since he
> replied. Here I just email you the sample code and error message:
>
> > example.3=data.frame(levels=as.numeric(XXX[,c(4)]),
> replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep(>
> example.3
>     levels replicate conditions
> 1  43.1111         0         11
> 2  42.0942         1         11
> 3  57.8131         2         11
> 4  57.1726         3         11
> 5  77.8678         4         11
> 6  44.7578         5         11
> 7  69.5078         0         12
> 8  52.0581         1         12
> 9  40.0602         2         12
> 10 45.5487         3         12
> 11 43.6201         4         12
> 12 60.4939         5         12
> 13 64.1932         0         13
> 14 53.4055         1         13
> 15 59.6701         2         13
> 16 52.6922         3         13
> 17 53.8712         4         13
> 18 60.2770         5         13
> > m.example.3=lmer(as.numeric(levels)~conditions+(
> conditions|replicate),data=example.3)
> Error in lmer(as.numeric(levels) ~ conditions + (conditions | replicate),
> :
>   could not find function "lmer"
> >
>
> Hopefully you could read it and provide some comments!
>
> Thank you very much for your time.
>
> Kind regards,
>
> Ace
>
>
>
>
> On Tuesday, November 14, 2017 6:12 PM, Bert Gunter <[hidden email]>
> wrote:
>
>
> Still a complete mess!
>
> Post in **plain text**. This should be an option in your email software.
> Please seek local help if you cannot figure out how to do this.
>
> -- Bert
>
>
>
> 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, Nov 14, 2017 at 12:49 PM, Fix Ace via R-help <[hidden email]
> > wrote:
>
> Hi, David,
> Thank you very much for getting back to me! Sorry about the messy code
> example. I am re-posting here (including the error message):
> > example.3=data.frame(levels= as.numeric(XXX[,c(4)]),
> replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c(
> rep("11",6),rep("12",6),rep(" 13",6)))> example.3    levels replicate
> conditions1  43.1111         0         112  42.0942         1         113
> 57.8131         2         114  57.1726         3         115  77.8678
>   4         116  44.7578         5         117  69.5078         0
> 128  52.0581         1         129  40.0602         2         1210 45.5487
>         3         1211 43.6201         4         1212 60.4939         5
>     1213 64.1932         0         1314 53.4055         1         1315
> 59.6701         2         1316 52.6922         3         1317 53.8712
>   4         1318 60.2770         5         13> m.example.3=lmer(as.numeric(
> levels)~conditions+( conditions|replicate),data= example.3)Error: number of
> observations (=18) <= number of random effects (=18) for term (conditions |
> replicate); the random-effects parameters and the residual variance (or
> scale parameter) are probably unidentifiable>
> Please let me know if it is readable this time.
> Again, many thanks for your time and please help me fix the issue.
> Kind regards,
> Ace
>
>     On Tuesday, November 14, 2017 12:19 PM, David Winsemius <
> [hidden email]> wrote:
>
>
>
> > On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help <[hidden email]>
> wrote:
> >
> > Dear R Community,
> > My data have 3 conditions and each condition has 6 replicates. I am
> trying to fit my data for a linear mixed model using the lmer function from
> lme4 package to find the random effects of the replicates;
>
> Better venue for this question might be SIG-mixed-models. See the link
> avaialble at the bottom of every posting from rhelp:
>
> https://stat.ethz.ch/mailman/ listinfo/r-help
> <https://stat.ethz.ch/mailman/listinfo/r-help>:
>
>
>
> > however, I got the error message. Here are the example codes:
> >> example.3=data.frame(levels= as.numeric(XXX[,c(4)]),
> replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c(
> rep("11",6),rep("12",6),rep(" 13",6)))> example.3    levels replicate
> conditions1  43.1111        0        112  42.0942        1        113
> 57.8131        2        114  57.1726        3        115  77.8678        4
>       116  44.7578        5        117  69.5078        0        128
> 52.0581        1        129  40.0602        2        1210 45.5487        3
>       1211 43.6201        4        1212 60.4939        5        1213
> 64.1932        0        1314 53.4055        1        1315 59.6701        2
>       1316 52.6922        3        1317 53.8712        4        1318
> 60.2770        5        13> m.example.3=lmer(as.numeric(
> levels)~conditions+( conditions|replicate),data= example.3)Error: number of
> observations (=18) <= number of random effects (=18) for term (conditions |
> replicate); the random-effects parameters and the residual variance (or
> scale parameter) are probably unidentifiable>
> > Could anyone help me figure out how to fix the issue?
> > Thank you very much for any inputs!
> > Ace
> >
> >     [[alternative HTML version deleted]]
>
> Complete mess. If you haven't yet been advised to posting in plain text,
> then this should be your wakeup call. If you have, then why are you
> ignoring sensible advice?
>
>
> >
> > ______________________________ ________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/ listinfo/r-help
> <https://stat.ethz.ch/mailman/listinfo/r-help>
> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html <http://www.r-project.org/posting-guide.html>
> > and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius
> Alameda, CA, USA
>
>
>
> 'Any technology distinguishable from magic is insufficiently advanced.'
> -Gehm's Corollary to Clarke's Third Law
>
>
>
>
>
>
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________ ________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/ listinfo/r-help
> <https://stat.ethz.ch/mailman/listinfo/r-help>
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html <http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>
>
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: error message for function: lmer (from lme4 package)

R help mailing list-2
Hi, Bert,
Thank you very much for the comments and suggestions!
Ace

    On Wednesday, November 15, 2017 10:44 AM, Bert Gunter <[hidden email]> wrote:
 

 Always cc the list, which I have done here. I am not a (free) private consultant, nor do I have all the answers.

Based on what you sent me, which is not what you have previously posted, you failed to load the lme3 package. See ?library.

As for the appropriateness of your modeling, you should do what David already suggested and post to the r-sig-mixed-models list instead.

-- Bert



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 Wed, Nov 15, 2017 at 5:09 AM, Fix Ace <[hidden email]> wrote:

Hi, Bert,
Sorry about that! David seemed to be able to read the post since he replied. Here I just email you the sample code and error message:
> example.3=data.frame(levels= as.numeric(XXX[,c(4)]), replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c( rep("11",6),rep("12",6),rep(> example.3    levels replicate conditions1  43.1111         0         112  42.0942         1         113  57.8131         2         114  57.1726         3         115  77.8678         4         116  44.7578         5         117  69.5078         0         128  52.0581         1         129  40.0602         2         1210 45.5487         3         1211 43.6201         4         1212 60.4939         5         1213 64.1932         0         1314 53.4055         1         1315 59.6701         2         1316 52.6922         3         1317 53.8712         4         1318 60.2770         5         13> m.example.3=lmer(as.numeric( levels)~conditions+( conditions|replicate),data= example.3)Error in lmer(as.numeric(levels) ~ conditions + (conditions | replicate),  :   could not find function "lmer"> 
Hopefully you could read it and provide some comments!
Thank you very much for your time.
Kind regards,
Ace

 

    On Tuesday, November 14, 2017 6:12 PM, Bert Gunter <[hidden email]> wrote:
 

 Still a complete mess!

Post in **plain text**. This should be an option in your email software. Please seek local help if you cannot figure out how to do this.

-- Bert 



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, Nov 14, 2017 at 12:49 PM, Fix Ace via R-help <[hidden email]> wrote:

Hi, David,
Thank you very much for getting back to me! Sorry about the messy code example. I am re-posting here (including the error message):
> example.3=data.frame(levels= as.numeric(XXX[,c(4)]), replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c( rep("11",6),rep("12",6),rep(" 13",6)))> example.3    levels replicate conditions1  43.1111         0         112  42.0942         1         113  57.8131         2         114  57.1726         3         115  77.8678         4         116  44.7578         5         117  69.5078         0         128  52.0581         1         129  40.0602         2         1210 45.5487         3         1211 43.6201         4         1212 60.4939         5         1213 64.1932         0         1314 53.4055         1         1315 59.6701         2         1316 52.6922         3         1317 53.8712         4         1318 60.2770         5         13> m.example.3=lmer(as.numeric( levels)~conditions+( conditions|replicate),data= example.3)Error: number of observations (=18) <= number of random effects (=18) for term (conditions | replicate); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable> 
Please let me know if it is readable this time. 
Again, many thanks for your time and please help me fix the issue.
Kind regards,
Ace

    On Tuesday, November 14, 2017 12:19 PM, David Winsemius <[hidden email]> wrote:



> On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help <[hidden email]> wrote:
>
> Dear R Community,
> My data have 3 conditions and each condition has 6 replicates. I am trying to fit my data for a linear mixed model using the lmer function from lme4 package to find the random effects of the replicates;

Better venue for this question might be SIG-mixed-models. See the link avaialble at the bottom of every posting from rhelp:

https://stat.ethz.ch/mailman/ listinfo/r-help:



> however, I got the error message. Here are the example codes:
>> example.3=data.frame(levels= as.numeric(XXX[,c(4)]), replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c( rep("11",6),rep("12",6),rep(" 13",6)))> example.3    levels replicate conditions1  43.1111        0        112  42.0942        1        113  57.8131        2        114  57.1726        3        115  77.8678        4        116  44.7578        5        117  69.5078        0        128  52.0581        1        129  40.0602        2        1210 45.5487        3        1211 43.6201        4        1212 60.4939        5        1213 64.1932        0        1314 53.4055        1        1315 59.6701        2        1316 52.6922        3        1317 53.8712        4        1318 60.2770        5        13> m.example.3=lmer(as.numeric( levels)~conditions+( conditions|replicate),data= example.3)Error: number of observations (=18) <= number of random effects (=18) for term (conditions | replicate); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable>
> Could anyone help me figure out how to fix the issue?
> Thank you very much for any inputs!
> Ace
>
>     [[alternative HTML version deleted]]

Complete mess. If you haven't yet been advised to posting in plain text, then this should be your wakeup call. If you have, then why are you ignoring sensible advice?


>
> ______________________________ ________________
> [hidden email] 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.

David Winsemius
Alameda, CA, USA


'Any technology distinguishable from magic is insufficiently advanced.'  -Gehm's Corollary to Clarke's Third Law







        [[alternative HTML version deleted]]

______________________________ ________________
[hidden email] 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.


   



   
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: error message for function: lmer (from lme4 package)

David Winsemius

> snipped
>
> Hi, Bert,
> Sorry about that! David seemed to be able to read the post since he replied.

The only reason it appear readable was that you copied me as well as the list. Then HTML was still  the basic format although it did npt appear that way to me since my reader could handle it without difficulty. Everybody else saw a "complete mess" as Bert accurately put it.

Again, learn to post in plain text. Learn to post data objects with dput.

--
David.
> Here I just email you the sample code and error message:
>> example.3=data.frame(levels= as.numeric(XXX[,c(4)]), replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c( rep("11",6),rep("12",6),rep(> example.3    levels replicate conditions1  43.1111         0         112  42.0942         1         113  57.8131         2         114  57.1726         3         115  77.8678         4         116  44.7578         5         117  69.5078         0         128  52.0581         1         129  40.0602         2         1210 45.5487         3         1211 43.6201         4         1212 60.4939         5         1213 64.1932         0         1314 53.4055         1         1315 59.6701         2         1316 52.6922         3         1317 53.8712         4         1318 60.2770         5         13> m.example.3=lmer(as.numeric( levels)~conditions+( conditions|replicate),data= example.3)Error in lmer(as.numeric(levels) ~ conditions + (conditions | replicate),  :   could not find function "lmer">
> Hopefully you could read it and provide some comments!
> Thank you very much for your time.
> Kind regards,
> Ace

snipped

>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[hidden email] 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.