0

In R I wish to perform non linear mixed effect models by assigning the terms QY, ALOS and expenditure as fixed variables and Month as a random variable. Is this the right format to perform the analysis? (Note : QY stands for quality of life, ALOS refers to average length of stay, Expenditure refers to the total expenditure borne by the patient during his surgery, DC refers to direct cost and IC is the indirect cost) The dataset looks like :

> head(sur_2019)
# A tibble: 6 x 6
  Month     ALOS Expenditure    IC    DC   QY
  <chr>    <dbl>       <dbl> <dbl> <dbl>  <dbl>
1 January   3.2        17800  4560 13240 0.0984
2 February  4.86       26790  5000 21790 1.08  
3 March     4.2        42500  7500 35000 0.843 
4 April     3.5        25000  5850 19150 0.234 
5 May       3.5        80000 16100 63900 0.385 
6 June      3.07       22780  6780 16000 0.120 

Analysis:

m1<-lme(QY~ALOS+Expenditure+Month,
          data=sur_2019, fixed=QY~ALOS+Expenditure, 
          random=~1|Month, na.action = na.omit,
          start=c(QY=1, ALOS=1, Expenditure=100))
  1. Error in lme(QY ~ ALOS + Expenditure + Month, data = sur_2019, fixed = QY ~ : unused argument (start = c(QY = 1, ALOS = 1, Expenditure = 100))
  1. Error in MEEM(object, conLin, control$niterEM) : Singularity in backsolve at level 0, block 1
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
Radhika
  • 11
  • 1
  • 1
    Hi, it is impossible to help you since you don't provide a minimal reproducible exemple : https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example. At least we need to know what does your dataset look like – Basti May 27 '21 at 07:53
  • Thank you for pointing out the clarification required @Bastien Ducreux . I have edited my question. Please have a look and in case you need some more information then I will update it again. Thanks – Radhika May 28 '21 at 00:15
  • This still isn't fully reproducible, but your main problem is most likely that you have specified `Month` both in the fixed and the random effects. Also, you've specified the formula twice. Try something like: `lme(fixed = QY~ALOS+Expenditure, data=sur_2019, random=~1|Month)`. You don't need starting values. And, this is a *linear* mixed model, not a *nonlinear* model. – Ben Bolker May 28 '21 at 01:03
  • Thank you for editing my question which now looks in a more presentable form. @BenBolker. Sir I have understood that it is first of all it is the case of linear mixed model and on applying the above commands I get the following error : m1<-lmer(QY~ALOS+Expenditure+(1|Month),data=sur_2019) Error: number of levels of each grouping factor must be < number of observations (problems: Month). PLease guide further – Radhika May 28 '21 at 05:30
  • We really need a [mcve] to get farther. Guessing: do you only have a single year of data, i.e. 12 observations? – Ben Bolker May 30 '21 at 16:53

0 Answers0