Displaying 20 results from an estimated 20000 matches similar to: "plotting positive predictive values"
2009 Sep 04
2
plot positive predictive values
Hi,
I'm trying to fit a smooth line in a plot(y ~ x) graph.
x is continuous variable
y is a proportion of success in sub-samples, 0 <= y <= 1, from a Monte
Carlo simulation.
For each x there may be several y-values from different runs. Each run
produces several sub-samples, where "0" mean no success in any sub-
sample, "0.5" means success in half of the
2011 Dec 01
3
Change the limits of a plot "a posteriori"
Hi all
How can I change the limits (xlim or ylim) in a plot that has been already
created?
For example, consider this naive example
curve(dbeta(x,2,4))
curve(dbeta(x,8,13),add=T,col=2)
When adding the second curve, it goes off the original limits computed by R
for the first graph, which are roughly, c(0,2.1)
I know two obvious solutions for this, which are:
1) passing a sufficiently large
2005 Jul 19
1
initial points for arms in package HI
Dear R-users
I have a problem choosing initial points for the function arms()
in the package HI
I intend to implement a Gibbs sampler and one of my conditional
distributions is nonstandard and not logconcave.
Therefore I'd like to use arms.
But there seem to be a strong influence of the initial point
y.start. To show the effect I constructed a demonstration
example. It is reproducible
2013 Apr 04
1
Plotting several functions in the same display (again)
To superimpose two functions plots in the same page. The functions L0
and L1, as defined below, I use the following code:
# An accumulative normal distribution function with
# several parametres
f0 <- function(mu, xm, ds, n) {
1 - pnorm((xm-mu)/(ds/sqrt(n)))
}
f1 <- function(mu,n) f0(mu, 386.8, 48, n)
# Two functions with just the parameter mu
L0 <- function(mu)
2004 Mar 24
0
Adapting thresholds for predictions of ordinal logistic regression
I'm dealing with a classification problem using ordinal logistic
regression. In the case of binary logistic regression with unequal
proportions of 0's and 1's, a threshold in the interval [0,1] has to be
adapted to transform back the predicted probabilities into 0 and 1.
This can be done quite straightforward using e.g. the Kappa statistics
as accuracy criterion.
With
2000 Aug 25
1
Re: [R] too large alpha or beta in dbeta ? (PR#643)
>>>>> "TL" == Thomas Lumley <thomas@biostat.washington.edu> writes:
TL> On Thu, 24 Aug 2000, Troels Ring wrote:
>> Dear friends.
>>
>> Is this as expected ? Is alpha and beta too large simply ?
>>
>> > dbeta(.1,534,646)
>> [1] NaN
>> Warning message:
>> NaNs produced in:
2011 Mar 29
1
plotting several ROC curves on the same graph
Hello
I am trying to make a graph of 10 different lines built each from 4
different
segments and to add a darker line that will represent the average of all
graphs
- all in the same plot.Actually each line is a ROC plot
The code I'm using for plotting one line is as follows:
logit.roc.plot <- function(r, title="ROC curve") {
old.par <- par(no.readonly = TRUE);
2017 Jun 26
0
Jagged ROC curves?
Hi Brian,
Your underlying dataset for the ROC curve only has 4 unique values for specificity, even though there are 23 elements in the vector, hence the step function nature of the first plot.
The default smoothing in the smooth() function is "binormal". You might try one of the other smoothing options to see the result and whether they make visual sense.
In the absence of smoothing,
2010 Feb 19
1
color graph in multiple plots
Hi,
I would like to distinguish my plots using colors but I got error message. How do I correct that?
plot(ecdf(z), main ="CDF for observed and simulated weighted sum",type="l",lwd=2,col="blue",
xlab="Weighted sum (mm)", ylab="Cumulative Percent", xlim=c(0,15), xaxs ='i', yaxs ='i',ylim=c(0,1))
par(new=TRUE)
2012 Jun 26
1
rms package-superposition prediction curve of ols and data points
Hello,
I have a question about the ?plot.predict? function in Frank Harrell's rms
package.
Do you know how to superpose in the same graph the prediction curve of ols
and raw data points?
Put most simply, I would like to combine these two graphs:
> fit_linear <- ols (y4 ~ rcs(x2,c(5,10,15,20,60,80,90)), x=TRUE, y=TRUE)
> p <- Predict(fit_linear,x2,conf.int=FALSE)
> plot (p,
2017 Aug 05
0
by() subset by factor gives unexpected results
The answer was (thanks to Mark Leeds) to do with the use of a factor
instead of a vector.
on [2017-08-05] at 08:57 Myles English writes:
> I am having trouble understanding how the 'by' function works. Using
> this bit of code:
>
> i <- data.frame(x=c(1,2,3), y=c(0,0,0), B=c("red","blue","blue"))
> j <- data.frame(x=c(1,2,3),
2017 Aug 05
3
by() subset by factor gives unexpected results
I am having trouble understanding how the 'by' function works. Using
this bit of code:
i <- data.frame(x=c(1,2,3), y=c(0,0,0), B=c("red","blue","blue"))
j <- data.frame(x=c(1,2,3), y=c(1,1,1), B=c('red','blue','green'))
plot(0, 0, type="n", xlim=c(0,4), ylim=c(0,1))
by(i, i$B, function(s){ points(s$x, s$y, col=s$B) })
2006 Mar 04
1
xyplot/levelplot: thickness of tickmarks
Hi,
if I use the xyplot (or levelplot) function (lattice library) with
the option axs="i", I have the problem that the tickmarks lie a bit
outside the "plot-box". Consider for example:
library(lattice)
x<-seq(0,1,by=0.01)
y<-seq(0,1,by=0.01)
xyplot(y~x,type="l",xlim=c(0,1),ylim=c(0,1),scales=list
2017 Jun 04
0
Hlep in analysis in RWinBugs
Hi R User,
I was trying to use R for WINBUGS using following model and data (example), but I am new with WINBUGS and don't know how we perform the analysis. I wonder whether I can run the following the example data and Winbugs Model in R. Your help will be highly appreciated.
Sincerely,
SN PANDIT
===
library(R2WinBUGS)
#Model
model{
#likelihood
for(i in 1:N){
a1[i] ~ dnorm(a11[i],tau)
2017 Jun 04
0
Help in analysis in RWinBugs
Hi R User,
I was trying to use R for WINBUGS using following model and data (example), but I am new with WINBUGS and don't know how we perform the analysis. I wonder whether I can run the following the example data and Winbugs Model in R. Your help will be highly appreciated.
Sincerely,
SN PANDIT
===
library(R2WinBUGS)
#Model
model{
#likelihood
for(i in 1:N){
a1[i] ~ dnorm(a11[i],tau)
2002 Nov 20
0
Plots by subject
Thomas,
Thank you for your reply about the for () loop. The as.character advice
worked. Sorry for the delay in getting back to?I had to set the project aside
for a few weeks.
This didn?t work exactly as is
for (patient in as.character(1:n)){
pt <- MRN == patient
(rest of the function)
}
But this did
for (patient in as.character(levels(MRN))){
pt <- MRN == patient
(rest of the function)
2004 Sep 22
1
pairs, panel.functions, xlim and ylim
Hi,
I have the following problem.
I wanted to get a matrix of scatterplots and I used pairs.
I wanted to add the line y=x in each plot and I created a panel
function for this scope.
I used points and abline in the following way:
## put y=x in each plot
panel.lin<- function(x, y)
{
points(x,y, pch=21, bg=par("bg"), col = "black",cex=2)
2006 Nov 17
0
setting up a plot without plotting any data
Someones you need to set up a plot before the
data is ready to plot. You know the desired
axis limits (xlim and ylim), but don't have
the data all in one vector. You would like to
set up the coordinate system, perhaps draw the
axes and titles, but draw no points. You can do that with
plot(x=xlim, y=ylim, type="n", xlab="", ylab="")
In R you could use
2007 Nov 15
1
Writing a helper function that takes in the dataframe and variable names and then does a subset and plot
Hi,
I have a large dataframe than I'm writing functions to explore, and to
reduce cut and paste I'm trying to write a function that does a subset
and then a plot.
Firstly, I can write a wrapper around a plot:
plotwithfits <- function(formula, data, xylabels=c('','')) {
xyplot(formula, data, panel =
function(x,y, ...) {
panel.xyplot(x,y,
2001 Oct 16
0
plot function
Hola!
It is somewhat inconvenient to use plot.function, when add=TRUE.
The following (miniscule) change makes it behave better:
plot.function <-
function (fn, from , to, xlim = NULL, ...)
{
if (!is.null(xlim)) {
if (missing(from))
from <- xlim[1]
if (missing(to))
to <- xlim[2]
}
curve(fn, from, to, xlim = xlim, ...)
}
The only