dosresmeta-error on linear analysis model

Hi,
I am currently trying to learn to do dose-response meta-analysis using the command dosresmeta.

When I tried to test for linearity model, the commands returned error:

library(dosresmeta)
lin_drma<-dosresmeta(formula=logrr~dose.hour, id=id, type=type, se=se, cases=event.n, n=total.n, data=sample)
summary(lin_drma)

This is the error code.

Error in diag(cx[v != 0] + cx[v == 0], nrow = sum(v != 0)) : 
  'x' must have positive length

Does anyone know which part of my code caused problem?
I tried to figure out but I could not solve this problem, since I am very new to R.

Please help, any help or advice will be very helpful.
Thank you very much.
Best,

Hi, I run the example and noticed you don't have a vector of variances v=v as required in the function.

I just used logrr^2 as fake data - just to have something delivered to the function, and the function worked.

this is my code and output:

code

library(dosresmeta)
library(gsheet)

sample = as.data.frame(gsheet::gsheet2tbl("https://docs.google.com/spreadsheets/d/1CVwj-j5SeA2Ba6iEeTZjzy7d41NnM6MR/edit#gid=766779254"))
sample$event.n <- as.integer(sample$event.n)

lin_drma<-dosresmeta(formula=logrr~dose.hour,type = type,se = se, v = logrr^2,
                     cases=event.n, id=id, n=total.n, data=sample)
summary(lin_drma)

output

Call:  dosresmeta(formula = logrr ~ dose.hour, id = id, v = logrr^2, 
    type = type, cases = event.n, n = total.n, data = sample, 
    se = se)

Two-stage random-effects meta-analysis
Estimation method: REML
Covariance approximation: Greenland & Longnecker

Chi2 model: X2 = 1.0367 (df = 1), p-value = 0.3086

Fixed-effects coefficients
             Estimate  Std. Error        z  Pr(>|z|)  95%ci.lb  95%ci.ub   
(Intercept)   -0.0004      0.0004  -1.0182    0.3086   -0.0013    0.0004   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Between-study random-effects (co)variance components
  Std. Dev
    0.0000

Univariate Cochran Q-test for residual heterogeneity:
Q = 1.9633 (df = 2), p-value = 0.3747
I-square statistic = 0.0%

3 studies, 3 values, 1 fixed and 1 random-effects parameters
 logLik      AIC      BIC  
 4.7692  -5.5384  -8.1521  
2 Likes

Hi Yaniv, thank you for your kind explaination.

We have applied your example to our "sample" datasheet, which is derived from a larger datasheet we have.

We have a couple more questions if you dont mind answering them;
Please check this main datasheet (Main datasheet_DRMA - Google Sheets)

  1. When the same code (with v = logrr^2 fake data) was applied to the main datasheet, the following error came up:
    "Error in if (delta < tol) break : missing value where TRUE/FALSE needed"
    Do you have any suggestions for how we can fix this?

  2. I am assuming v here is variance. How can we derive variance from standard error in the datasheet? We're not statisticians and thus unfamiliar with this process.
    (In the rstudio help, we found that v is 'a vector to specify the variances of the reported outcome. Alternatively the user can provide the standard error in the se argument, or only for log relative risks, the confidence interval in the lb and ub arguments.'
    --> I cannot understand why v is not delivered even though there is a se axis in the dataset. We tried v=se or v=se^2 but same errorcode came up...
    Error in diag(cx[v != 0] + cx[v == 0], nrow = sum(v != 0)) : 'x' must have positive length )

  3. Why did you convert "event.n" data into integer form? Is it necessary for the process?

Thanks again,

I'll answer as much as I can:

  1. Question - 3 - No need to change event.n to integer but since cases requires a counting variable you might want to use total.n instead.

  2. Question 1 - The error means there are empty or zero cells in the vector. In the little example the vector was complete so it gave no error. Please note that you have se = standard error column but don't have sd or variance column which is a bit suspicious because you cannot compute standard error without knowing s.d or variance.

  3. se = standard error = sd = standard deviance - You should use se^2

Thank you Yaniv,

A problem has solved !
I think the real problem was that we have to set se value as N/A in control groups but I didn't...

Your advice was very helpful and also helped me study more.
I really appreciate your kind help.
Best,

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.