Re: [R] R for mac

2020-09-28 Thread Dr Eberhard Lisse
Michael, I would propose the easiest way (and appropriate in a student setting is via Homebrew (https://brew.sh/) /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" brew install R brew cask install Rstudio and thereafter

Re: [R] How can we get a predicted value that are used to plot the figure using a plot_model function of sjPlot?

2020-09-28 Thread Paul Bivand
If you read ?plot_model() there is a description of type="pred" that suggests fuller details are found under ?ggeffect() from the ggeffects package. This in turn suggests that if you use 'ggpredict()' with arguments that replicate those you used in plot_model(), you get a data.frame with the value

[R] Problem with contour()

2020-09-28 Thread Helmut Schütz
Dear all, I can't get my head around how contour lines are drawn. Working example(x and y are parameters of a certain test and z the resulting power): library(PowerTOST) x    <- 0.90 y    <- 0.35 res  <- as.numeric(sampleN.TOST(theta0 = x, CV = y, design = "2x2x4",

[R] Problem with contour(): typo

2020-09-28 Thread Helmut Schütz
Dear all, sorry, my last message contained a typo. Correct: library(PowerTOST) x    <- 0.90 y    <- 0.35 res  <- as.numeric(sampleN.TOST(theta0 = x, CV = y, design = "2x2x4",     method = "central", details = FALSE,     print = FALSE)[7:8

Re: [R] Problem with contour(): typo

2020-09-28 Thread Duncan Murdoch
You're doing a lot of manipulation of the z matrix; I haven't followed all of it, but that's where I'd look for problems. Generally if you keep your calculation of the z matrix very simple you are better off. For example, once you have xs and ys in the form you want, calculate z as z <- outer

[R] 2 KM curves on the same plot

2020-09-28 Thread array chip via R-help
Hello, Can anyone suggest a simple way to generate a Kaplan-Meier plot with 2 survfit objects, just like this one:  https://drive.google.com/file/d/1fEcpdIdE2xYtA6LBQN9ck3JkL6-goabX/view?usp=sharing Suppose I have 2 survfit objects: fit1 is for the curve on the left (survtime has been truncate