similar to: question on how to extract values from atomic vector

Displaying 20 results from an estimated 20000 matches similar to: "question on how to extract values from atomic vector"

2017 Jun 26
3
Jagged ROC curves?
Hi, I was trying to draw some ROC curves (prediction of case/control status), but seem to be getting a somewhat jagged plot. Can I do something that would 'smooth' it somewhat? Most roc curves seem to have many incremental changes (in x and y directions), but my plot only has 4 or 5 steps even though there are 22 data points. Should I be doing something differently? How can I provide a
2017 Jun 26
0
Jagged ROC curves?
> On Jun 26, 2017, at 11:40 AM, Brian Smith <bsmith030465 at gmail.com> wrote: > > Hi, > > I was trying to draw some ROC curves (prediction of case/control status), > but seem to be getting a somewhat jagged plot. Can I do something that > would 'smooth' it somewhat? Most roc curves seem to have many incremental > changes (in x and y directions), but my plot
2004 Mar 29
1
Interpreting knn Results
Maybe you should show your colleague how to access help pages in R? Right in ?knn, it says: prob: If this is true, the proportion of the votes for the winning class are returned as attribute 'prob'. so 1.0 mean all three NNs are of the `winning'; i.e., predicted, class, and 0.66667 means 2 out of the 3 NNs are of the winning class, etc. Andy > From: Ko-Kang
2009 Jun 22
2
what's the R command to make the following?
Hi, I have a simple question, suppose I have the date "05/16/2008", what would be the command to get the month, day and year? Thanks, -Jack [[alternative HTML version deleted]]
2010 Mar 12
3
how to plot only the upper triangle using the pairs function?
Hi, I am trying to use function pairs to plot the scatterplot, but I only want to keep the upper triangle, what's the argument to do this? Thanks, -Jack [[alternative HTML version deleted]]
2009 Jul 15
4
Extract pairs (rowname, columname) from a matrix where value is 0
Dear sir, I have a matrix like a<-matrix(c(0,2,0,4,0,6,5,8,0),nrow=3) colnames(a)<-c("F1","F2","F3") rownames(a)<-c("A1","A2","A3") a F1 F2 F3 A1 0 4 5 A2 2 0 8 A3 0 6 0 I want to extract all pairs (rownames, columnames) from which the value in the matrix is 0 The result should be something like this A1, F1 A2,
2017 Jul 28
3
problem with "unique" function
I have the joint distribution of three discrete random variables z1, z2 and z3 which is captured by "z" and "prob" as described below. For example, the probability for z1=0.46667, z2=-1 and z3=-1 is 2.752e-13. Also, the probability adds up to 1. > head(z) z1 z2 z3 [1,] -0.46667 -1.0000 -1.0000 [2,] -0.33333 -0.9333 -0.9333 [3,] -0.20000 -0.8667 -0.8667
2008 Jan 19
1
how to use different variable to store values with different length in a loop
Hi, List I am trying to use variables named A1, A2, ..., A100 to store some values, each variable could store some values with different length, how can I achieve this? Thanks, Jack [[alternative HTML version deleted]]
2017 Jul 28
0
problem with "unique" function
Most likely, previous computations have ended up giving slightly different values of say 0.13333. A pragmatic way out is to round to, say, 5 digits before applying unique. In this particular case, it seems like all numbers are multiples of 1/30, so another idea could be to multiply by 30, round, and divide by 30. -pd > On 28 Jul 2017, at 17:17 , li li <hannah.hlx at gmail.com> wrote:
2006 Aug 04
2
Sampling from a Matrix
Hello all, Consider the following problem: There is a matrix of probabilities: > set.seed(1) > probs <- array(abs(rnorm(25, sd = 0.33)), dim = c(5,5), dimnames = list(1:5, letters[1:5])) > probs a b c d e 1 0.21 0.27 0.50 0.0148 0.303 2 0.06 0.16 0.13 0.0053 0.258 3 0.28 0.24 0.21 0.3115 0.025 4 0.53 0.19 0.73 0.2710 0.656 5 0.11 0.10 0.37 0.1960
2011 Aug 17
2
question regarding gregexpr and read.table
Hi, I have a silly question regarding the usage of two commands: read.table and gregexpr: For read.table, if I read a matrix and set header = T, I found that all the dash ("-") becomes dots (".") A = read.table("Matrix.txt", sep = "\t", header = F) A[1,1] # "A-B-C-D". A = read.table("Matrix.txt", sep = "\t", header = T)
2007 Oct 29
2
help please
hello, please can anyone help me out. Am a new user of R program. Am having problem with this code below, not getting the expected results. Each m, the cumulative sum should be 1.000 but the 2nd and 3rd m returned 2.000 and 3.000 instead of 1.000. thanks Aruike pp=function(x,n,M){z=1.0;a=2.3071430;b=7.266064;H=3 out.h=c() out.y=c() out.m=c() out.prob=c()
2009 Jul 17
1
Arules questions. I need some help please
Question 2a) I am also working with arules package and I have the following problem let suppose the matrix b like: b<-matrix(c(1,1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1),nrow=6) rownames(b)=c("T1", "T2", "T3", "T4", "T5", "T6") colnames(b)=c("It1", "It2", "It3", "It4") bt<-as(b,
2009 Nov 10
1
how to suppress the output from stepAIC?
Hi, I am now running a cross-validation using coxph coupled with stepAIC for model selection, is there anyway to suppress the output? It's too much. -Jack [[alternative HTML version deleted]]
2008 Dec 09
1
Can elastic net do binary classification?
Hi, List The elastic net package (by Hastie and Zou at Stanford) is used to do regularization and variable selection, it can also do regression. I am wondering if it can perform binary classification (discrete outcome). Anybody having similar experience? Many thanks, -Jack [[alternative HTML version deleted]]
2011 Aug 17
1
question regarding headers with space in the names
Hi, After I read an xlsx file into the work space: A <- read.xlsx("B.xls", header = T, check.names = F) There are several headers with the names like: colnames(A) [1:4] # [1] "A 1" "B" [3] "C 2" "D" I can get the content of column 2 and column 4 easily by A$B or A$D However, I can not type
2003 May 01
2
What' wrong?
I try to do single proportion test on my category data. Here is my R script: library("ctest") catSignifTest <- function( catFile ) { ############################################################### ## Get the data sets from text file catData <- read.table( catFile ) ncols <- length(catData) nrows <- length(catData[,1]) ncol1 <- ncols - 1 probeNbr
2007 Oct 26
5
help
hello, please can anyone help me out. Am a new user of R program. Am having problem with this code below, not getting the expected results. 1. Each m, the cumulative sum should be 1.000 but the 2nd and 3rd m returned 2.000 and 3.000 instead of 1.000. 2. to get the LCL(m) and UCL(m) for each m base on these instructions if out.cum > 0.025 then LCL(m)= y-1 if out.cum >0.975
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,
2009 Nov 22
3
Define return values of a function
I have created a function to do something: i <- factor(sample(c("A", "B", "C", NA), 793, rep=T, prob=c(8, 7, 5, 1))) k <- factor(sample(c("X", "Y", "Z", NA), 793, rep=T, prob=c(12, 7, 9, 1))) mytable <- function(x){ xtb <- x btx <- x # do more with x, not relevant here cat("The table has been created,