[R-meta] Error with rma.uni in a Monte Carlo simulation

Michael Dewey ||@t@ @end|ng |rom dewey@myzen@co@uk
Wed Mar 6 12:26:58 CET 2024


?try

will probably help

Michael

On 06/03/2024 05:58, Will Hopkins via R-sig-meta-analysis wrote:
> Chat GPT helped me to write the code to analyze 5000 simulated datasets I
> had created in SAS. It worked fine for a small number of simulations, but
> when I ran it for 5000, I got an error and no results.  See below for the
> code, due mainly to ChatGPT (I added the control statement in a failed
> attempt to get past the error, after I consulted the documentation),
> followed by the error message. Can someone tell me how to get past the
> error? When an analysis fails in SAS with "by Sim" processing, it simply
> doesn't output that particular dataset.  Thanks heaps.
> 
>   
> 
> Will
> 
>   
> 
> # Function to perform meta-analysis using rma.uni
> 
> perform_meta_analysis <- function(xxx) {
> 
>    # Perform meta-analysis using rma.uni
> 
>    meta_analysis <- rma.uni(yi = xxx$Ydelta, vi = xxx$YdeltaSEsq,
> mods=xxx$Female01, control=list(maxiter=400))
> 
>    
> 
>    # Return results
> 
>    return(meta_analysis)
> 
> }
> 
>   
> 
> # List to store meta-analysis results
> 
> meta_results <- list()
> 
>   
> 
> # Perform meta-analysis for each dataset
> 
> for (i in 1:max(data$Sim)) {
> 
>    # Subset data for the current meta-analysis
> 
>    meta_data <- subset(data, Sim == i)
> 
>   
> 
>    # Perform meta-analysis using rma.uni
> 
>    result <- perform_meta_analysis(meta_data)
> 
>    # Store result
> 
>    meta_results[[i]] <- result
> 
> }
> 
>   
> 
> Here's the error:
> 
> Error in rma.uni(yi = xxx$Ydelta, vi = xxx$YdeltaSEsq, mods = xxx$Female01,
> :
> 
>    Fisher scoring algorithm did not converge. See 'help(rma)' for possible
> remedies.
> 
>   
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-meta-analysis mailing list @ R-sig-meta-analysis using r-project.org
> To manage your subscription to this mailing list, go to:
> https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis



More information about the R-sig-meta-analysis mailing list