0
$\begingroup$

Good evening, I know this post could not more out of moment today, but I try the same publishing it, hoping someone may help when possible. I'm working on a multilevel dataset in order to figure out which treatment between 2 may affect the outcome variable. On this purpose, the following covariates have been take into account several covariates from each subjects, including:

  1. the centre where they have been picked up from (10 in overall);
  2. the area where each centre was located (the 4 cardinal points);
  3. whether the clinic was private or not (2 values);

and further covariates, both numeric and factorial ones;

I'm trying building a random-effects model to validate the likelihood of each subjects to assume one of the two treatments, but I'm keeping on getting the same Error message:

Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.0100983 (tol = 0.002, component 1)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model is nearly unidentifiable: very large eigenvalue
 - Rescale variables?;Model is nearly unidentifiable: large eigenvalue ratio
 - Rescale variables?

So, due to the multi-level structure of the data, I am supposed to choose the best way to rescale variables. Which one of the multi-level variables mentioned before and belonging to this dataset I should scale? Should I use either the scale() function or anyone else? How that should be used? I specify that the model I'm seeking for building it is carried out by the glmer function of the lme4's package.

Many thanks and happy holidays

$\endgroup$
1
  • $\begingroup$ This is not about rescaling, so don't use scale() to attempt to solve this. Please provide the code you used to fit the model and, if possible, the dataset. Likely you misspecified the model in such a way that it can't be estimated. $\endgroup$
    – Noah
    Commented Dec 26, 2020 at 20:05

2 Answers 2

2
$\begingroup$

Impossible to answer your question unless you provide more details. At a minimum, you would need to share the actual formula you used to fit your model in R. It would also help if you clarified how you treat each predictor included in your model in R: numeric or factor?

$\endgroup$
0
$\begingroup$

Just for providing further details, here following is the dataset with some main information:

tibble [3,000 x 13] (S3: tbl_df/tbl/data.frame)
 $ hosp_id      : num [1:3000] 1 1 1 1 1 1 1 1 1 1 ... #corresponding to number 1 of the aforementioned list and including 10 centrers
 $ sub_id       : int [1:3000] 1 2 3 4 5 6 7 8 9 10 ... #subjects  ID
 $ age          : num [1:3000] 51.4 50.2 51.6 57.2 60.5 ...
 $ sbp          : num [1:3000] 140 144 145 166 176 ...
 $ dbp          : num [1:3000] 85.8 76.1 77.5 100.3 125.2 ...
 $ bmi          : num [1:3000] 22.4 22.1 22.6 25.1 25.9 ...
 $ cholesterol  : num [1:3000] 161 176 176 195 195 ...
 $ sex          : Factor w/ 2 levels "male","female": 1 1 1 1 2 2 1 1 2 2 ...
 $ smoker       : Factor w/ 2 levels "no","yes": 1 1 1 2 1 2 2 2 2 2 ...
 $ area         : Factor w/ 4 levels "north","east",..: 3 3 3 3 3 3 3 3 3 3 ... #the area where each hospital is located (the four cardinal points)
 $ public       : Factor w/ 2 levels "private","public": 1 1 1 1 1 1 1 1 1 1 ... #clinic tipology (private or public)
 $ cabg         : Factor w/ 2 levels "angioplasty",..: 2 1 2 2 2 2 2 2 2 2 ... #treatment variable (angioplasty or cabg) 
 $ death_30_days: Factor w/ 2 levels "no","yes": 1 2 1 2 1 1 2 2 2 1 ... #outcome (death within 30 days from receiving the treatment) 

The model I should build require to scale variables and account the probabiltiy to receive one between the two treatment (cabg or angioplasty), according to a propensity score analysis criteria. As I've been keeping getting the errore I've mentioned above, I am supposed to scale variables in the following formula.

    ps_random <- glmer(formula = cabg ~ age + sbp + dbp + 
        bmi + cholesterol + sex + smoker + area + public + 
        (1 | hosp_id), 
        data = cabg_df, 
    family = binomial("logit")
)

Which should I pick up? Which criteria should I stick to? How and could I scale the variables? Should I scale every of them? Thanks for paying attention.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.