Re: [R] please help generate a square correlation matrix

2024-07-25 Thread Bert Gunter
If I have understood the request, I'm not sure that omitting all 0 pairs for each pair of columns makes much sense, but be that as it may, here's another way to do it by using the 'FUN' argument of combn to encapsulate any calculations that you do. I just use cor() as the calculation -- you can use

Re: [R] OFF TOPIC: Nature article on File Drawer Problem in Reserach

2024-07-25 Thread Robert Baer
Chapter 9 might be of interest: https://bookdown.org/MathiasHarrer/Doing_Meta_Analysis_in_R/ And specifically, for funnel plots in R: https://wviechtb.github.io/metafor/reference/funnel.html Best, Rob On 7/25/2024 6:40 AM, Richard O'Keefe wrote: I know you didn't want to stimulate discussion,

Re: [R] please help generate a square correlation matrix

2024-07-25 Thread Rui Barradas
Às 20:47 de 25/07/2024, Yuan Chun Ding escreveu: Hi Rui, You are always very helpful!! Thank you, I just modified your R codes to remove a row with zero values in both column pair as below for my real data. Ding dat<-gene22mut.coded r <- P <- matrix(NA, nrow = 22L, ncol = 22L,

Re: [R] please help generate a square correlation matrix

2024-07-25 Thread Yuan Chun Ding via R-help
Hi Rui, You are always very helpful!! Thank you, I just modified your R codes to remove a row with zero values in both column pair as below for my real data. Ding dat<-gene22mut.coded r <- P <- matrix(NA, nrow = 22L, ncol = 22L, dimnames = list(names(dat), names(dat))) for(i

Re: [R] please help generate a square correlation matrix

2024-07-25 Thread Yuan Chun Ding via R-help
HI Rui, Thank you for the help! You did not remove a row if zero values exist in both column pair, right? Ding From: Rui Barradas Sent: Thursday, July 25, 2024 11:15 AM To: Yuan Chun Ding ; r-help@r-project.org Subject: Re: [R] please help generate a square correlation matrix Às 17: 39 de 25

Re: [R] please help generate a square correlation matrix

2024-07-25 Thread Rui Barradas
Às 17:39 de 25/07/2024, Yuan Chun Ding via R-help escreveu: Hi R users, I generated a square correlation matrix for the dat dataframe below; dat<-data.frame(g1=c(1,0,0,1,1,1,0,0,0), g2=c(0,1,0,1,0,1,1,0,0), g3=c(1,1,0,0,0,1,0,0,0), g4=c(0,1,0,1,

[R] please help generate a square correlation matrix

2024-07-25 Thread Yuan Chun Ding via R-help
Hi R users, I generated a square correlation matrix for the dat dataframe below; dat<-data.frame(g1=c(1,0,0,1,1,1,0,0,0), g2=c(0,1,0,1,0,1,1,0,0), g3=c(1,1,0,0,0,1,0,0,0), g4=c(0,1,0,1,1,1,1,1,0)) library("Hmisc") dat.rcorr = rcorr(as.matrix(dat)) da

Re: [R] OFF TOPIC: Nature article on File Drawer Problem in Reserach

2024-07-25 Thread Richard O'Keefe
I know you didn't want to stimulate discussion, but the problem is not confined to publication. "Adverse reaction to medication" monitoring programs are plagued by a similarly massive under-reporting problem: adverse reactions are seldom reported unless they are particularly bad or surprising. (T