Skip to content
Prev 4824 / 5636 Next

[R-meta] question on scatter plot of estimates (Fisher's Z) against the standard error

Dear Michael,
Here is the code below:
Thanks a lot.
Kind regards,
Gabriel

## Transformation of Pearson's Product-moment correlation coefficient (r)
to Fisher's Z
dat <-escalc(measure = "ZCOR",
             ri = ri,
             ni = ni,
             data = dat)

##
funnel_all <- rma.mv(yi,
                     vi,
                     # mods = ~ Type,
                     random = ~ 1 | Article / Sample_ID,
                     data=dat)

funnel_all
## funnel plot form metafor
funnel(funnel_all)

## Variance : from general model extracted
vi_data <-funnel_all$vi

## Estimates : from general model extracted estimates
yi_data <-funnel_all$yi[1:150]

## calculate standard error SE: square root of the variance
SE<- sqrt(vi_data)

# estimates
E <-funnel_all$yi

## construct data frame
df <- data.frame (Estimates = c(E), Standsrd_Error = c(SE))
View(df)
library(ggplot2)
## Scatter plot
scaleFUN <- function(x) sprintf("%.2f", x)
p<- ggplot(df, aes(x=Estimates, y=Standsrd_Error)) +
  geom_point(aes(size = Estimates), alpha=0.7,  color="#2568E6")+
  scale_size_area() +
  labs(x = "Fisher's z",
       y = "Standard Error (SE)")+
  theme(plot.title = element_text(hjust = 0.5))+
 # theme(plot.margin = unit(2 ,8, 8, 2), "cm"))+
  scale_y_continuous(n.breaks = 12,labels=scaleFUN)+
  scale_x_continuous(n.breaks = 12,labels=scaleFUN)+
  geom_vline(xintercept = 0)+
  theme(axis.text.y = element_text(size = 15))+
  theme(axis.text.x = element_text(size = 15))+
  theme(axis.title.y = element_text(size = 15))+
  theme(axis.title.x = element_text(size = 15))+
  ggtitle( "Fisher's z vs. Standard Error")+
  theme(plot.title = element_text(size = 17, face = "bold"))+
  theme(legend.text = element_text(size = 15))
  p
png(filename = "myplot.png", width = 28,  height = 18 ,units = "cm" , res
=100 )
print(p)
dev.off()



On Thu, Jul 20, 2023 at 4:51?PM Michael Dewey <lists at dewey.myzen.co.uk>
wrote: