Re: [R] how to specify uncorrelated random effects in nlme::lme()

2024-01-09 Thread Viechtbauer, Wolfgang (NP)
Dear Zhen, You can use this with pdDiag(). An example: library(nlme) res <- lme(distance ~ age*Sex, random = list(Subject = pdDiag(~ age)), data=Orthodont) summary(res) Best, Wolfgang > -Original Message- > From: R-help On Behalf Of ?? > Sent: Monday, January 8, 2024 1

Re: [R] Try reproduce glmm by hand

2023-12-03 Thread Viechtbauer, Wolfgang (NP)
n 1:nrow(df)) { lli[i] <- log(integrate(intfun, xi=df[i,1], mi=df[i,2], pred=fixep[1] + fixep[2]*x[i], theta=par$theta, lower=-Inf, upper=Inf)$value) } -sum(lli) Best, Wolfgang > -Original Message- > From: R-help On Behalf Of Marc Girondot via R- > help > Sent: Saturday, D

Re: [R] MASS::mvrnorm() on MKL may produce different numbers even when the seed is the same?

2023-08-17 Thread Viechtbauer, Wolfgang (NP)
sdom' that one can only guarantee full reproducibility if one locks the machine in a safe isn't even true unless one takes extra steps when using MKL. Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bill Dunlap >Sent: Th

Re: [R] MASS::mvrnorm() on MKL may produce different numbers even when the seed is the same?

2023-08-17 Thread Viechtbauer, Wolfgang (NP)
u0, Sigma = sigma0)[1, 1:5] [1] 0.4851605 0.5704446 1.6873036 2.7645014 -0.2020908 > set.seed(1234) > MASS::mvrnorm(n = 5, mu = mu0, Sigma = sigma0)[1, 1:5] [1] 0.4851605 0.5704446 1.6873036 2.7645014 -0.2020908 Best, Wolfgang >-Original Message- >From: R-help [mailto

Re: [R] Variable and value labels

2023-07-12 Thread Viechtbauer, Wolfgang (NP)
ble levels thereof mtcars$am <- factor(mtcars$am, levels=c(0,1), labels=c("automatic","manual")) mtcars # add a variable label via comment() comment(mtcars$am) <- "Type of transmission" # extract all the variable labels sapply(mtcars, comment) Best, Wolfgang >-

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-31 Thread Viechtbauer, Wolfgang (NP)
,1), mar=c(1,4.5,0,2), oma=c(3,0,1,0)) plot(DAX.[, 1], log='y', ylab='DAX', axes=FALSE) axis(2) box(col='grey') plot(DAX.[, 2], ylab='vel (%)', axes=FALSE) axis(2) box(col='grey') plot(DAX.[, 3], ylab='accel (%)', axes=FALSE) axis(2)

Re: [R] foreign package: unable to read S-Plus objects

2023-01-17 Thread Viechtbauer, Wolfgang (NP)
hese are supposed to be read into S-Plus (and if they are even compatible with this version, although version 6 was the current version between 2001 and 2005). Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Kevin Thorpe >Sen

[R] Interactive 3D Plot with non-numeric axis tick labels

2023-01-09 Thread Wolfgang Grond
Dear all, What I want to create is an interactive 3D plot from a data frame like this: #: number TLD: Countrycode Date: date String: a label Because plot3d can only deal with numbers I converted Date to Year and TLD as well as String to a numeric value like this: numTLD <- as.numeric(factor(df

Re: [R] Can browseURL open a lynx browser?

2022-03-20 Thread Viechtbauer, Wolfgang (SP)
Dear Ashim, If you really want to use lynx, then you need to open up a new terminal to make this work. For example, this will do: browseURL("http://www.r-project.org","xterm -e lynx") But this will open up a new terminal for each call to browseURL(). Best, Wolfgang &g

Re: [R] Creating NA equivalent

2021-12-21 Thread Viechtbauer, Wolfgang (SP)
Tobit models. Just explore these packages to see what they can do. Best, Wolfgang >-Original Message- >From: Chris Evans [mailto:chrish...@psyctc.org] >Sent: Tuesday, 21 December, 2021 12:56 >To: Viechtbauer, Wolfgang (SP) >Cc: r-help@r-project.org >Subject: Re: Creat

Re: [R] Creating NA equivalent

2021-12-21 Thread Viechtbauer, Wolfgang (SP)
Tobit model, which can be fitted using the survival package (or censReg). Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Chris Evans >Sent: Tuesday, 21 December, 2021 12:17 >To: Duncan Murdoch >Cc: r-help@r-project.org &

Re: [R] Using update() within a function with a changed formula

2021-11-13 Thread Wolfgang Viechtbauer
Perfectly clear. Thanks! Best, Wolfgang On Sat, 13 Nov 2021, Duncan Murdoch wrote: On 13/11/2021 2:24 p.m., Viechtbauer, Wolfgang (SP) wrote: Hello all, Say I would like to change the outcome in a formula to a variable not part of the original dataset. This works just fine: res <- lm(

[R] Using update() within a function with a changed formula

2021-11-13 Thread Viechtbauer, Wolfgang (SP)
unction(x) { y <- rnorm(nobs(x)) update(x, formula = y ~ .) } f(res) Is there a way to make this work? Using y <<- ... inside the function works, but I would like to avoid such a heavy-handed approach. Best, Wolfgang __ R-help@r-project.org

Re: [R] geom_node_point color in ggraph

2021-04-15 Thread Wolfgang Grond
Rui, thanks a lot, I'll try it this way. Best regards Wolfgang Am 15. April 2021 21:19:27 MESZ schrieb Rui Barradas : >Hello, > >To define the colors, remove the data set name from the aesthetic. >This > >aes(colour = project_all$Acronym) > > >should be this &g

[R] geom_node_point color in ggraph

2021-04-15 Thread Wolfgang Grond
olor palette to use? Please point me to where I should look how to do it. Many thanks in advance Wolfgang [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/

Re: [R] evil attributes

2021-04-12 Thread Viechtbauer, Wolfgang (SP)
>-Original Message- >From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] >Sent: Monday, 12 April, 2021 1:58 >To: Viechtbauer, Wolfgang (SP); R-help >Subject: Re: [R] evil attributes > >On 11/04/2021 2:46 p.m., Viechtbauer, Wolfgang (SP) wrote: >> The is.vector

Re: [R] evil attributes

2021-04-11 Thread Viechtbauer, Wolfgang (SP)
mp;& !is.list(x) I am sure there are all kinds of edge (and probably also not so edge) cases where these also fail to work properly. Kinda curious if there are better approaches out there. Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org]

Re: [R] Stata/Rstudio evil attributes

2021-04-10 Thread Viechtbauer, Wolfgang (SP)
side RStudio we’re not responsible, so try Stack >Overflow". This is pretty much what I would have expected from the capitalist >running dogs they are. Admittedly, the error is probably due to some >unforeseen This kind of bashing is really silly. Can you tell us again how much you

Re: [R] Assigning several lists to variables whose names are contained in other variables

2021-04-09 Thread Wolfgang Grond
ore neccessary to assign the result of the function to a variable whose name consists of a fixed string and the content of a further variable. That was the intention for me to ask. Am 9. April 2021 17:22:05 MESZ schrieb David Winsemius : > >On 4/9/21 5:21 AM, Wolfgang Grond wrote: >> G

Re: [R] Assigning several lists to variables whose names are contained in other variables

2021-04-09 Thread Wolfgang Grond
David, I don't think that this is the case. When I do the calculation like this subnet_MYSUBNET <- my_function(MYSUBNET), i.e. assigning a variable by hand to each function result, all is fine. Am 9. April 2021 17:22:05 MESZ schrieb David Winsemius : > >On 4/9/21 5:21 AM,

Re: [R] Assigning several lists to variables whose names are contained in other variables

2021-04-09 Thread Wolfgang Grond
Folks, first of all - thanks a lot for your hints! I will try each again and think about, why I get error messages. But to resume: if I understand you right: there is no way to do something like this: $name = $result? Regards Wolfgang Am 9. April 2021 15:43:27 MESZ schrieb Rui Barradas

Re: [R] Assigning several lists to variables whose names are contained in other variables

2021-04-09 Thread Wolfgang Grond
Greg, here I get the error message: Error my_function(val) : cannot find function my_function. Am 9. April 2021 12:35:40 MESZ schrieb Greg Minshall : >Wolfgang, > >> result <- assign(paste("subnet_",  val, sep = "") >> >> result <- my_fun

Re: [R] Assigning several lists to variables whose names are contained in other variables

2021-04-09 Thread Wolfgang Grond
Ivan, same situation when I try your list() solution: Error in eval ... : object 'function' not found ( I think anything about my_function is meant). Am 9. April 2021 13:43:57 MESZ schrieb Ivan Krylov : >Dear Wolfgang, > >On Fri, 9 Apr 2021 11:48:55 +0200 >Wolfgang Gro

Re: [R] Assigning several lists to variables whose names are contained in other variables

2021-04-09 Thread Wolfgang Grond
Dear Ivan, when I try your solution with lapply as below I get the following error message: Error in eval ... : object 'function' not found ( I think anything about my_function is meant). Am 9. April 2021 13:43:57 MESZ schrieb Ivan Krylov : >Dear Wolfgang, > >On Fri, 9 Apr

[R] Assigning several lists to variables whose names are contained in other variables

2021-04-09 Thread Wolfgang Grond
t succeed at least. Am I wrong? Where is my mistake? Many thanks in advance for any hint. Wolfgang [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo

[R] Identifying tidygraph subgraphs

2021-04-05 Thread Wolfgang Grond
ws: nodes a, b, c have i. e. color blue as they originate from gr1, nodes f, g, h, i, j, k, l, m have i. e. color red as they originate from gr2, nodes d, e either have color blue or color red (depending in which sequence the graphs are joined), or nodes d. e have a third color,

Re: [R] forest plot -metafor package

2021-03-22 Thread Viechtbauer, Wolfgang (SP)
Dear Usmle Ck, This is what the 'slab' argument is for (for adding 'study labels'). For an example, see: https://www.metafor-project.org/doku.php/plots:forest_plot Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] O

Re: [R] about a p-value < 2.2e-16

2021-03-19 Thread Viechtbauer, Wolfgang (SP)
.] Warning message: In wilcox.test.default(c(1, 3, 2, 2, 4), exact = TRUE) : cannot compute exact p-value with ties Best, Wolfgang >-Original Message- >From: Jiefei Wang [mailto:szwj...@gmail.com] >Sent: Friday, 19 March, 2021 16:32 >To: Viechtbauer, Wolfgang (SP) >Cc: r-help &g

Re: [R] about a p-value < 2.2e-16

2021-03-19 Thread Viechtbauer, Wolfgang (SP)
Dear Jiefei, This behavior is documented. From help(wilcox.test): "By default (if exact is not specified), an exact p-value is computed if the samples contain less than 50 finite values and there are no ties. Otherwise, a normal approximation is used." Best, Wolfgang >-Ori

Re: [R] Monospaced font not shown correctly (Xubuntu 20.04)

2021-01-20 Thread Viechtbauer, Wolfgang (SP)
/DejaVuSansMono.ttf Substitute your favorite (ttf/otf) monospaced font above. Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Viechtbauer, >Wolfgang (SP) >Sent: Wednesday, 20 January, 2021 10:10 >To: Paul Mu

Re: [R] Monospaced font not shown correctly (Xubuntu 20.04)

2021-01-20 Thread Viechtbauer, Wolfgang (SP)
Ah, nevermind. X11Fonts() is only for Xlib. I'll see if I can figure out how to get 'fc-match Courier' to point to a otf/ttf font. I guess this is explained here: https://www.freedesktop.org/software/fontconfig/fontconfig-user.html Best, Wolfgang >-Original Message-

Re: [R] Monospaced font not shown correctly (Xubuntu 20.04)

2021-01-20 Thread Viechtbauer, Wolfgang (SP)
"mono") plot(1) works. So does X11(family="Courier New") # type="cairo" by default plot(1) or X11(family="Inconsolata") plot(1) Can I not override what is specified under X11Fonts() with? Because this does not work: X11Fonts(mono="-*-inconsolata-%s-%s

[R] Monospaced font not shown correctly (Xubuntu 20.04)

2021-01-19 Thread Viechtbauer, Wolfgang (SP)
r:style=Italic /usr/share/fonts/type1/texlive-fonts-recommended/pcrbo8a.pfb: Courier:style=Bold Italic Any other ideas how to fix this? Best, Wolfgang (happy to move this to R-SIG-Debian if this would be more appropriate) > sessionInfo() R version 4.0.3 (2020-10-10) Platform: x86_64-pc-linux-gnu (6

Re: [R] roxygen2 & markdown & math

2021-01-12 Thread Viechtbauer, Wolfgang (SP)
Dear Sigbert, The mathjaxr package provides this: https://cran.r-project.org/package=mathjaxr https://github.com/wviechtb/mathjaxr Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Sigbert >Klinke >Sent: Tuesday, 12 Januar

Re: [R] Error message in meta-analysis package Metafor-weights =""

2020-06-23 Thread Viechtbauer, Wolfgang (SP)
You have loaded the 'meta' package after 'metafor' and then forest() will try to use the corresponding function from the meta package and not metafor. With: metafor::forest(result.md) it should work. Best, Wolfgang >-Original Message- >From: K Amoatwi [m

Re: [R] Error message in meta-analysis package Metafor-weights =""

2020-06-23 Thread Viechtbauer, Wolfgang (SP)
Dear Kobby, Please post the output of sessionInfo() and class(result.md). Best, Wolfgang >-Original Message- >From: K Amoatwi [mailto:amoatwi...@gmail.com] >Sent: Monday, 22 June, 2020 22:30 >To: Viechtbauer, Wolfgang (SP) >Cc: r-help@r-project.org >Subject: Re: [R

Re: [R] Error message in meta-analysis package Metafor-weights =""

2020-06-16 Thread Viechtbauer, Wolfgang (SP)
benefits. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com >-Original Message- >From:

[R] [R-pkgs] mathjaxr: Using 'Mathjax' in Rd Files

2020-05-09 Thread Viechtbauer, Wolfgang (SP)
quations not only in the PDF manual, but also in the HTML help files (which the vast majority of users are probably looking at). Feedback, comments, suggestions more than welcome. For bug reports, please go to: https://github.com/wviechtb/mathjaxr/issues Best, Wolfgang _

Re: [R] I am struggling with contrasts

2020-03-10 Thread Viechtbauer, Wolfgang (SP)
ed)." For a single linear combination, vcov will be a >single value and its square-root the SE. Best, Wolfgang -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Sorkin, John Sent: Tuesday, 10 March, 2020 11:51 To: peter dalgaard; Berwin A Tu

Re: [R] Conditional Logistic Regression with Multilevel Data [using clogistic() in Epi and lmer() in lme4???]

2019-07-03 Thread Wolfgang Viechtbauer
No need to install metafor for lme4. Best, Wolfgang On July 3, 2019 5:19:13 PM GMT+02:00, Marc Schwartz wrote: >Hi Heather, > >I would defer to the mixed models experts, but I think that the basic >approach using nested random effects seems to make sense. > >I don’t kn

Re: [R] Conditional Logistic Regression with Multilevel Data [using clogistic() in Epi and lmer() in lme4???]

2019-07-03 Thread Wolfgang Viechtbauer
Ouch, that was a brain fart on my part! But indeed, since we can fit a 'single-site model' using glmer() (as shown), we should be able to just add 'site' as another random effect with (1 | site / id). Best, Wolfgang On July 3, 2019 1:26:54 PM GMT+02:00, Marc Schwart

Re: [R] Conditional Logistic Regression with Multilevel Data [using clogistic() in Epi and lmer() in lme4???]

2019-07-03 Thread Viechtbauer, Wolfgang (SP)
noticed a slight issue with the structuring of the output from rma.glmm() -- if you want to run that example, install the 'devel' version of metafor as described here: https://wviechtb.github.io/metafor/#installation Best, Wolfgang -Original Message- From: R-help [mai

Re: [R] Substitution in expressions

2019-03-26 Thread Viechtbauer, Wolfgang (SP)
I initially had a loop, but wanted something vectorized (the vector of expressions is being used as an argument in a function call). But I am happy with sticking to mapply() (plus the slight simplification suggested by Peter Dalgaard). Best, Wolfgang -Original Message- From: Bert

Re: [R] Substitution in expressions

2019-03-26 Thread Viechtbauer, Wolfgang (SP)
Hi Bert, I am indeed creating a mathematical expression, but ?plotmath doesn't cover how to do such a vectorized substitution. Best, Wolfgang -Original Message- From: Bert Gunter [mailto:bgunter.4...@gmail.com] Sent: Tuesday, 26 March, 2019 15:52 To: Viechtbauer, Wolfgang (SP)

Re: [R] Substitution in expressions

2019-03-26 Thread Viechtbauer, Wolfgang (SP)
Ok, thanks. Happy to stick with mapply() then. Best, Wolfgang -Original Message- From: peter dalgaard [mailto:pda...@gmail.com] Sent: Tuesday, 26 March, 2019 15:40 To: Viechtbauer, Wolfgang (SP) Cc: r-help mailing list Subject: Re: [R] Substitution in expressions I think mapply() is

Re: [R] Substitution in expressions

2019-03-26 Thread Viechtbauer, Wolfgang (SP)
Apologies for not being clearer. The code does what I want, but I was wondering if there is a simpler way of doing this, using substitute()/bquote() directly without the mapply(). Best, Wolfgang -Original Message- From: peter dalgaard [mailto:pda...@gmail.com] Sent: Tuesday, 26 March

[R] Substitution in expressions

2019-03-26 Thread Viechtbauer, Wolfgang (SP)
xpo <- c(2,2,3,3,4) exvec <- as.expression(unname(mapply(function(x,y) bquote(.(x)^.(y)), base, expo))) plot(NA, NA, xlim=c(0,6), ylim=c(0,2)) text(1:5, 1, exvec) Any ideas how I could get this to work with substitute() and/or bquote()? Best, Wolfgang _

Re: [R] differences between meat and metafor packages

2019-02-27 Thread Viechtbauer, Wolfgang (SP)
ata=a, method="REML", slab=paste(a$study), digits=3) Best, Wolfgang -Original Message- From: greg holly [mailto:mak.hho...@gmail.com] Sent: Monday, 25 February, 2019 21:20 To: Viechtbauer, Wolfgang (SP) Subject: Re: [R] differences between meat and metafor packages Hi Wolfg

Re: [R] differences between meat and metafor packages

2019-02-25 Thread Viechtbauer, Wolfgang (SP)
The second argument (called 'vi') in rma() is for the variances. If you have SEs, then use the 'sei' argument: res <- rma(HR, sei=SE, data=a) Best, Wolfgang -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of greg holly Sent: Monda

Re: [R] R and factorytalk historian

2018-12-12 Thread Viechtbauer, Wolfgang (SP)
Dear Petr, Sorry, no experience with the FTH, but related to this, has anybody gotten R to interface nicely with the Retro Encabulator, providing live read outs of the synchronizing cardinal grammeters? (my apologies, I just couldn't resist) Best, Wolfgang >-Original Message---

Re: [R] meta analysis for sensitivity and specificity

2018-12-07 Thread Viechtbauer, Wolfgang (SP)
ould want to use a bivariate model. There are some specific packages for this. See the Meta-Analysis Task View (https://cran.r-project.org/web/views/MetaAnalysis.html). I just saw that Michael also replied with the same suggestion (and the note about the mailing list). Best, Wolfgang >--

[R] [R-pkgs] New package cNORM: Continuous norming

2018-12-03 Thread Wolfgang Lenhard
gate.net/publication/303785307_A_Continuous_Solution_to_the_Norming_Problem Best regards,     Wolfgang Lenhard -- Prof. Dr. Wolfgang Lenhard Institute for Psychologie IV D-97070 Würzburg, Germany URL: https://go.uniwue.de/lenhard ___ R-packages mailing list r-pa

Re: [R] Combine by columns a vector with another vector that is constant across rows

2018-07-03 Thread Viechtbauer, Wolfgang (SP)
s fastest, but Gabor's Reduce(cbind, vec, x) is close (and I really like its simplicity); and very similar to the do.call() approach. Interestingly, for larger vectors, such as: x <- 1:50 vec <- sample(1:100, 200, replace=TRUE) the do.call() approach is the fastest. Best, Wolfgan

[R] Combine by columns a vector with another vector that is constant across rows

2018-07-03 Thread Viechtbauer, Wolfgang (SP)
in replicate(): cbind(1:5, t(replicate(5, vec))) Other ways that do not require this are: t(sapply(1:5, function(x) c(x, vec))) do.call(rbind, lapply(1:5, function(x) c(x, vec))) t(mapply(c, 1:5, MoreArgs=list(vec))) I wonder if there is a simpler / more efficient way of doing this. B

[R] linear regression with repeated measures

2018-04-09 Thread Wolfgang Raffelsberger
to change the standard errors, I'm shur what is the best way to do so # or 2) is there a package allowing to do these steps, thus returning correct DF, Std Err and Pr(>|t) ? Thanks in advance, Wolfgang Raffelsberger for completeness : sessionInfo() > sessionInfo() R version 3.4.4 (201

Re: [R] Codes to conduct network meta-analysis, gemtc package

2018-02-15 Thread Viechtbauer Wolfgang (SP)
This aside, there is the R-sig-meta-analysis mailing list where this probably belongs: https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bert >Gunter >Sent: Thursday,

[R] xyTable(x,y) versus table(x,y) with NAs

2017-12-12 Thread Viechtbauer Wolfgang (SP)
Hi All, It seems to me that xyTable() gets thrown off by NAs: x <- c(1, 1, 2, 2, 2, 3) y <- c(1, 2, 1, 3, NA, 3) table(x, y, useNA="always") xyTable(x, y) Is this intended behavior? Best, Wolfgang __ R-help@r-project.org ma

Re: [R] Change Rcode for a meta-analysis(netmeta) to use a random effects model instead of a mixed effects model

2017-06-29 Thread Viechtbauer Wolfgang (SP)
used?" Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jay Zola >Sent: Thursday, June 29, 2017 19:38 >To: r-help@r-project.org >Subject: [R] Change Rcode for a meta-analysis(netmeta) to use a random >effects model inst

Re: [R] Classic fail-safe N

2017-06-26 Thread Viechtbauer Wolfgang (SP)
I would suggest to post this to the (recently created) R-sig-meta-analysis mailing list. See: https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis Best, Wolfgang >-Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Naike Wang >Sent: Monday

Re: [R] adding predictor to linear model without changing existing coefficients

2017-05-17 Thread Viechtbauer Wolfgang (SP)
e intercept; in res3 the intercept is reestimated. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer

Re: [R] R-3.4.0 and survival_2.41-3 ..

2017-04-25 Thread Viechtbauer Wolfgang (SP)
s may not be the most efficient method if you use hundreds of packages, but works for me. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD Maastricht, The Netherlands |

Re: [R] matafor package - categorical moderator interpretation question

2017-04-03 Thread Viechtbauer Wolfgang (SP)
ipants)'. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com -Original Message- From: R

Re: [R] How to select one value per row (different columns) from array

2017-03-01 Thread Wolfgang Waser
herefore b) having to work around it in a most inelegant manner. Thanks again! On 1 March 2017 15:38:15 CET, William Michels wrote: >Hello Wolfgang, > >Building on Peter Dalgaard's code, are you just trying to take a sample >of >a random column from each row? You don't ne

[R] How to select one value per row (different columns) from array

2017-03-01 Thread Wolfgang Waser
that row. Is there a non-loop way to pick the 999 values from the array, probably using some form of ?apply? Thank you very much for help and suggestions! Wolfgang __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https

Re: [R] Metafor multilevel metaregression: total variance increases when moderator added?

2017-02-28 Thread Viechtbauer Wolfgang (SP)
th the profile() function) and/or get (profile-likelihood) CIs of the variance components (using the confint() function). Probably the CI for the study-level variance component is quite wide. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsycholog

Re: [R] metafor rma.mv weights questions

2017-02-02 Thread Viechtbauer Wolfgang (SP)
). See also help(rma.mv) in metafor. So, if you fit an appropriate model to the data at hand, the 'default weights' used by rma.mv() will be just fine. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsychology | Maastricht University

Re: [R] funnel plot asymmetry

2016-08-01 Thread Viechtbauer Wolfgang (STAT)
The 'meta' and 'metafor' packages provide this. See also the meta-analysis task view: https://cran.r-project.org/web/views/MetaAnalysis.html (especially: "Investigating small study bias"). Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician

Re: [R] t-test for regression estimate

2016-06-28 Thread Viechtbauer Wolfgang (STAT)
But the second column in coef(summary(ols1)) gives you the SE, so why not use that? Otherwise, you may want to look into the 'multcomp' package and its glht() function. Best, Wolfgang > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] How to extract same columns from identical dataframes in a list?

2016-02-10 Thread Wolfgang Waser
m not enough of a programer to always make complete sense of the R help pages. Should I have found this information in the sapply - R help page? Where else could I check before pestering the R mailing list, which, of course, provides quick and valuable answers. Cheers, Wolfgang On 09/02/1

Re: [R] How to extract same columns from identical dataframes in a list?

2016-02-09 Thread Wolfgang Waser
applying a function to margins of an array or matrix"). Thanks for you help and suggestions! Wolfgang On 08/02/16 18:00, Dénes Tóth wrote: > Hi, > > Although you did not provide any reproducible example, it seems you > store the same type of values in your data.frames. If th

[R] How to extract same columns from identical dataframes in a list?

2016-02-08 Thread Wolfgang Waser
re direct way to select for specific columns instead of selecting a range of values, avoiding loops? Cheers, Wolfgang __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the po

Re: [R] Mean effect size in meta-analysis using Metafor

2015-12-21 Thread Viechtbauer Wolfgang (STAT)
model should then be identical to the intercept from the model with the categorical moderator, indicating that the discrepancy is exactly due to the fact described under the link provided by Michael. If not, there is something else going on. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D

Re: [R] R: forest plot metafor

2015-12-12 Thread Viechtbauer Wolfgang (STAT)
width=4) par(mar=c(5,4,4,6)) forest(res, xlim=c(-7,8), digits=c(2,0)) mtext(wi, side=4, at=13:1, line=4, las=2, adj=1) par(xpd=TRUE) abline(h=c(0,14)) par(xpd=FALSE) Adjust as needed for your data. Best, Wolfgang From: R-help [r-help-boun...@r-project.o

Re: [R] metafor package

2015-12-08 Thread Viechtbauer Wolfgang (STAT)
ns). Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com > -Original Message- > Fro

Re: [R] metafor package

2015-12-08 Thread Viechtbauer Wolfgang (STAT)
Hi John, Please keep r-help copied on the reply. What's the 'previous model'? How do you get estimates within subgroups that 'includes the overall effect'? I really cannot follow you here. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Dep

Re: [R] metafor package

2015-12-07 Thread Viechtbauer Wolfgang (STAT)
es with text() in an appropriate place to the plot. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.co

Re: [R] metafor - Meta-Analysis of rare events / beta-binomial regression

2015-11-27 Thread Viechtbauer Wolfgang (STAT)
ma.mh() and rma.peto() for the Mantel-Haenszel and Peto's method. I may also eventually include the beta-binomial model, but I need to give this some more thought. If you already want to start using this model, you will find implementions thereof in VGAM, aods3, and gamlss. Best, Wolfg

Re: [R] How to calculate the shared area of 2 plots?

2015-10-31 Thread Viechtbauer Wolfgang (STAT)
Something like this? http://stats.stackexchange.com/questions/12209/percentage-of-overlapping-regions-of-two-normal-distributions Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD

Re: [R] Installing different R versions

2015-10-07 Thread Wolfgang Raffelsberger
Linux) Wolfgang 2015-10-07 9:04 GMT+02:00 Loris Bennett : > Dear Luca, > > Luca Cerone writes: > > > Dear all, > > on one shared machine we have an older R version installed. Some packages > > have known issues with that version that are fixed in newer R versions.

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-31 Thread Viechtbauer Wolfgang (STAT)
g/doku.php/analyses:konstantopoulos2011 Using "random = ~ 1 | author" is likely to be insufficient. You also need to add random effects at the observation level. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsychology | Maastricht University |

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-25 Thread Viechtbauer Wolfgang (STAT)
im' values, and 'ilab.xpos' values to create a nice looking plot that has no overlapping text and no excessive white space. An example is this: http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups Note that it took me dozens of iterations to create that pl

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-25 Thread Viechtbauer Wolfgang (STAT)
Further comments in line as well. > -Original Message- > From: Michael Dewey [mailto:li...@dewey.myzen.co.uk] > Sent: Tuesday, August 25, 2015 13:23 > To: Marco Colagrossi; Viechtbauer Wolfgang (STAT) > Cc: r-help@r-project.org > Subject: Re: [R] Metafor and forest();

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-24 Thread Viechtbauer Wolfgang (STAT)
i.e., studies). The example given here can provide some clues how one could go about this: http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups But drawing a plot like this requires a lot of hand-tweaking. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Depa

[R] (ordinal) logistic regression

2015-07-16 Thread Wolfgang Raffelsberger
the H0 ?) to obtain low and NOT high p-values (example below) in the case I'm looking for, ie when group-means are distinct. Any suggestions ? Thank’s in advance, Wolfgang Here my toy-example : datB1 <- c(12,14:16,18:21,20:22,20,22:24,19.5) # fit partially/overlapping to 3grp mode

Re: [R] Altering Forest plot in Metafor package

2015-07-14 Thread Viechtbauer Wolfgang (STAT)
argument allows you to add columns with additional information to the plot. Please read help(forest.rma) carefully and especially try out all of the examples. They illustrate the use of these arguments. Best, Wolfgang From: R-help [r-help-boun...@r-project.or

Re: [R] Looking up the code for a function

2015-05-06 Thread Viechtbauer Wolfgang (STAT)
Probably these are non-exported functions. Try: getAnywhere() Or if you know which package a function comes from: ::: Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician Department of Psychiatry and Neuropsychology School for Mental Health and Neuroscience Faculty of

Re: [R] Metafor - rma.mv function - variance components

2015-04-21 Thread Viechtbauer Wolfgang (STAT)
ith those SEs. Wald-type tests (z-tests) should generally be avoided when testing variance components. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician Department of Psychiatry and Neuropsychology School for Mental Health and Neuroscience Faculty of Health, Medicine,

Re: [R] 'metafor' - standardized mean difference in pre-post design studies

2015-04-14 Thread Viechtbauer Wolfgang (STAT)
nt groups is n1+n2-2 > > Essentially, J = 1 - (3/4*((n1+n2)-2) - 1) > > Ultimately, g = J x d, and variance of g (Vg) = J^2 x Vd > > I had some hint by Wolfgang Viechtbauer, but I'm stucked on here > (essentially, because my poor programming abilities) > I was stuck

Re: [R] Trim and fill procedure

2015-04-07 Thread Viechtbauer Wolfgang (STAT)
rimfill(res) ### show log relative risks and dummy variable to indicate augmented values data.frame(tmp$yi, tmp$fill) ### that's in fact how the funnel() function knows how to draw the points when you do: funnel(tmp) Best, Wolfgang > -Original Message- > From: R-help [mailto:r-h

Re: [R] the making of _R_ eBooks

2015-03-24 Thread Dr. Wolfgang Lindner
ry easy to use R markdown, see: | http://rmarkdown.rstudio.com/ Dear Sven, dear Amos, that's what I was looking for! Thanks for pointing me to rmarkdown, rticles package and the Tufte template. best, Wolfgang G Lindner Leichlingen, Germany __ R-help@r

Re: [R] the making of _R_ eBooks

2015-03-23 Thread Dr. Wolfgang Lindner
Dear Prof. Ripley, thank you for the 2 links w/r to my question. Section 2.3 in 'R Installation and Administration' seems very condensed to me. But there is a mention of Calibre, I will read about all that. | > PLEASE do read the posting guide | PLEASE do! I did. Best Wol

Re: [R] the making of _R_ eBooks

2015-03-23 Thread Dr. Wolfgang Lindner
any hint or link by expert R users. | Oh, well, that excludes me. I'm not an expert. No, your answer includes you :) It was very helpful. Indeed, I should better have said 'enthusiastic R users' ;) best Wolfgang - Original Message - From: "John McKown" To

[R] the making of _R_ eBooks

2015-03-23 Thread Dr. Wolfgang Lindner
m not sure, if there are better possibilities.. Thanks for any hint or link by expert R users. Wolfgang Lindner Leichlingen, Germany __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Tele_R - first experiences

2015-03-19 Thread Dr. Wolfgang Lindner
Some R users asked offlist for the link to Tele_R. Sorry, here it is: [3] http://telemath.altervista.org/ -- Best, Wolfgang Lindner Am 19.03.2015 um 21:57 schrieb Ista Zahn : > Hey that's really nice. I'm not sure how practical it is, but it works > surprisingly well. &

[R] Tele_R - first experiences

2015-03-19 Thread Dr. Wolfgang Lindner
ld like to hear about the experiences, opinions or ideas of other members of the R community with respect of the use of Tele_R. I hope that this is not the wrong list to say these words. Best, Wolfgang Lindner Leichlingen, Germany __ R-help@r-project.o

[R] Course and book announcements on r-help

2015-03-13 Thread Viechtbauer Wolfgang (STAT)
So, I am wondering if such announcements are somewhat implicitly discouraged. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician Department of Psychiatry and Psychology School for Mental Health and Neuroscience Faculty of Health, Medicine, and Life Sciences Maastricht

[R] - PLS-Package - PLSR loadings

2014-12-16 Thread Wolfgang Obermeier
Dear Subscribers, how is it possible that the loadings of the second or even third component of a PLS-Analysis show higher values than the first component? Somebody got an idea?? Thanks in advance, Wolfgang -- Dipl. Geogr. Wolfgang Obermeier Faculty of Geography Philipps-University of

Re: [R] How to have NLME return when convergence not reached

2014-12-03 Thread Viechtbauer Wolfgang (STAT)
-models/2008q3/001429.html https://stat.ethz.ch/pipermail/r-sig-mixed-models/2008q3/001431.html I don't know if that is related to the present case, but it sounds a bit like it. Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician Department of Psychiatry and Psychology Schoo

Re: [R] arcsine transformation with metafor

2014-11-24 Thread Viechtbauer Wolfgang (STAT)
> radial(res) > funnel(res) They are not wrong. The double arcsine transformed values are used for the plotting, not the raw proportions. In particular, the plots are based on 'yi' in: > dat xi nipi yi vi 1 3 11 0.2727273 0.5695 0.0217 2 6 17 0.3529412 0.

Re: [R] Comparing summary hazard ratios in meta-analysis

2014-11-21 Thread Viechtbauer Wolfgang (STAT)
sform hazard ratios and compute standard error based on the CI bounds yi <- log(hr) sei <- (log(ci.ub) - log(ci.lb)) / (2*1.96) library(metafor) res <- rma(yi ~ factor(meta), sei=sei, method="FE") res So, yes, the two hazard ratios are significantly different from each other.

  1   2   3   4   >