Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
. Should be equivalent in theory. Felix Am 03.03.12 22:13, schrieb peter dalgaard: > > On Mar 3, 2012, at 20:25 , drflxms wrote: > >> "Once you go into two dimensions, SD loses all meaning, and adding >> nonparametric density estimation into the mix doesn't help, so just

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
, schrieb peter dalgaard: > > On Mar 3, 2012, at 20:25 , drflxms wrote: > >> "Once you go into two dimensions, SD loses all meaning, and adding >> nonparametric density estimation into the mix doesn't help, so just stop >> thinking in those terms!" >>

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
1 and x2 are normally distributed with > mean 0 (or have the mean subtracted), then x1^2/v1 +x2^2/v2 is chi > squared distributed with 2 degrees of freedom. > > So if you really want to you can try to approximate the contours in > some other way, but any decent approach will just conver

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
=line.width[cont.level]) } } } ## ##Test the function ## ##generate data if(testit){ n=1 a<-list("x"=rnorm(n,400,100),"y"=rweibull(n,2,100)) draw.contour(a=a,alpha=c(0.95,0.5,0.05),line.width=c(2,1,2),

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
book, website etc.) Greetings from Munich, Felix. Am 03.03.12 19:22, schrieb peter dalgaard: > > On Mar 3, 2012, at 17:01 , drflxms wrote: > >> # this is the critical block, which I still do not comprehend in detail >> z <- array() >> for (i in 1:n){ >>

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
ckage (and the ellipse function in the package) > for a simple way of showing a confidence region for bivariate data on > a plot (a 68% confidence interval is about 1 SD if you just want to > show 1 SD). > > On Sat, Mar 3, 2012 at 7:54 AM, drflxms wrote: >> Dear all, >

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
ey are really true. Still hoping for some replies ;), Felix Am 03.03.12 15:54, schrieb drflxms: > Dear all, > > I created a bivariate normal distribution: > > set.seed(138813) > n<-100 > x<-rnorm(n); y<-rnorm(n) > > and plotted a scatterplot of it: >

[R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
Dear all, I created a bivariate normal distribution: set.seed(138813) n<-100 x<-rnorm(n); y<-rnorm(n) and plotted a scatterplot of it: plot(x,y) Now I'd like to add the 2D-standard deviation. I found a thread regarding plotting arbitrary confidence boundaries from Pascal Hänggi http://www.mai

Re: [R] percentile of a given value: is there a "reverse" quantile function?

2012-03-03 Thread drflxms
Felix Am 03.03.12 14:33, schrieb peter dalgaard: > > On Mar 3, 2012, at 13:37 , drflxms wrote: > >> Dear all, >> >> I am familiar with obtaining the value corresponding to a chosen >> probability via the quantile function. >> Now I am facing the op

[R] percentile of a given value: is there a "reverse" quantile function?

2012-03-03 Thread drflxms
Dear all, I am familiar with obtaining the value corresponding to a chosen probability via the quantile function. Now I am facing the opposite problem I have a value an want to know it's corresponding percentile in the distribution. So is there a function for this as well? Thank you for your supp

[R] plotting standard deviation of multivariate normal distribution (preferred in rgl package)

2012-03-02 Thread drflxms
Dear R colleagues, for a statistics tutorial I want to develop a nice 3d-graphic of the well known target comparison/analogy of accuracy and precision (see i.e. http://en.wikipedia.org/wiki/Accuracy_and_precision for a simple hand made 2d graphic). The code for a really beautiful graphic is alrea

Re: [R] splitting strings effriciently

2012-01-08 Thread drflxms
Hi Andrew, I am aware, that this is an R-mailing list, but for such tasks (I deal a lot with huge genomic datasets) I tend to use awk and sed for preprocessing of data, in case I run into performance problems. Otherwise for handling of strings in R I recommend stringr library, but I don't know abo

Re: [R] colouring a table, data.frame or matrix in an interactive R session

2012-01-08 Thread drflxms
Am 07.01.12 21:12, schrieb Michael Friendly: > On 1/7/2012 5:48 AM, drflxms wrote: >> Hi everybody, >> >> as I am dealing with complex confusion matrices, I wonder whether there >> might be a way to colour text/tabular data in R. I.e. imagine >> highlighting th

Re: [R] colouring a table, data.frame or matrix in an interactive R session

2012-01-08 Thread drflxms
Am 08.01.12 13:52, schrieb Vincent Zoonekynd: > On 7 January 2012 19:48, drflxms wrote: > >> as I am dealing with complex confusion matrices, I wonder whether there >> might be a way to colour text/tabular data in R. I.e. imagine >> highlighting the true positive values

[R] colouring a table, data.frame or matrix in an interactive R session

2012-01-07 Thread drflxms
Hi everybody, as I am dealing with complex confusion matrices, I wonder whether there might be a way to colour text/tabular data in R. I.e. imagine highlighting the true positive values or certain classes in a table. I know how to colour text in graphical output as well as how to sweave or odfWea

Re: [R] sorting a data.frame (df) by a vector (which is not contained in the df) - unexpected behaviour of match and factor

2011-12-29 Thread drflxms
; /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --- > Sent from my phone. Please excuse my brevity. > > drflxms wrote: > >> Dear R colleagues, >> >> consider my data.frame named

[R] sorting a data.frame (df) by a vector (which is not contained in the df) - unexpected behaviour of match and factor

2011-12-29 Thread drflxms
Dear R colleagues, consider my data.frame named "df" with 3 columns - being level, prevalence and sensitivity - and 7 rows of data (see dump below). df <- structure(list(level = structure(1:7, .Label = c("0", "1", "10", "100", "1010", "11", "110"), class = "factor"), prevalence = structure(c(4L,

Re: [R] How to use a variable after $ ($x) for subscripting a list, How to source from a character object (source(x))

2011-09-13 Thread drflxms
it is frustratingly opaque as to its > function). Specifically, > > R> identical(A$a, A[["a"]]) > TRUE > > R> identical(A$a,A[[1]]) > TRUE > > If this doesn't work, please clarify what exactly the object you have is and > what you are tryi

[R] How to use a variable after $ ($x) for subscripting a list, How to source from a character object (source(x))

2011-09-13 Thread drflxms
Dear R colleagues, as result of a function a huge list is generated. From this result list I'd like to extract information. Think of the list i.e. as an object named "listResult" with the following form: [[a]] [1] [2] [3] [4] [5] [[b]] [1] [2] [3] [4] [5] [[c]] [1] [2] [3] [4] [5] where le

[R] how to sort the levels of a table

2011-08-16 Thread drflxms
Dear colleagues, I have really heavy problems in sorting the results of a table according to certain features of the levels in the table. Prerequisites: It all starts with a fairly simple data set, which stores observations of 21 observers (horizontally from 1 to 21; 21 is reference/goldstandard

Re: [R] sum of digits or how to slice a number into its digits

2011-03-04 Thread drflxms
Dimitris Rizopoulos: > one way is using function strsplit(), e.g., > > x <- c("100100110", "1001001", "1101", "00101") > sapply(strsplit(x, ""), function (x) sum(x == 1)) > > > I hope it helps. > > Best, > Dimitr

[R] sum of digits or how to slice a number into its digits

2011-03-04 Thread drflxms
Dear R colleagues, I face a seemingly simple problem I couldn't find a solution for myself so far: I have to sum the digits of numbers. Example: 1010 ->2 100100110 -> 4 Unfortunately there seems not to be a function for this task. So my idea was to use sum(x) for it. But I did not figure out how

[R] selecting only corresponding categories from a confusion matrix

2010-11-29 Thread drflxms
Dear R colleagues, as a result of my calculations regarding the inter-observer-variability in bronchoscopy, I get a confusion matrix like the following: 0 1 1001 1010 11 0609 11 54 36 6 1 1 260 2 1014 008 4 1004 000 0 1000 23

Re: [R] can't load rJava in R 2.8.1 on Windows XP

2009-01-23 Thread drflxms
AM, drflxms wrote: >> Dear community, >> >> unfortunately I did not manage load the rJava package receiving the >> following >> error-message: >> >> >>> library("rJava") >> Error in inDL(x, as.logical(local), as.logical(now), ...) : kan

[R] can't load rJava in R 2.8.1 on Windows XP

2009-01-23 Thread drflxms
Dear community, unfortunately I did not manage load the rJava package receiving the following error-message: > library("rJava") Error in inDL(x, as.logical(local), as.logical(now), ...) : kann shared library 'C:/Programme/R/2.8.1/library/rJava/libs/rJava.dll' nicht laden: LoadLibrary failure:

Re: [R] how to address last and all but last column in dataframe

2008-09-06 Thread drflxms
; > Patrick Burns > [EMAIL PROTECTED] > +44 (0)20 8525 0696 > http://www.burns-stat.com > (home of S Poetry and "A Guide for the Unwilling S User") > > drflxms wrote: >> Dear R-colleagues, >> >> another question from a newbie: I am creating a lot of simple &g

[R] how to address last and all but last column in dataframe

2008-09-06 Thread drflxms
Dear R-colleagues, another question from a newbie: I am creating a lot of simple pivot-charts from my raw data using the reshape-package. In these charts we have medical doctors judging videos in the columns and the videos they judge in the rows. Simple example of chart/data.frame "input" with two

Re: [R] Free SQL Database with R

2008-09-03 Thread drflxms
ich case R would > query the database do the analysis and write the analysis back to the > database (I guessing that is the way it would be done), before it gets > displayed on the web page. > > Kind Regards > > Chibisi > > On Wed, Sep 3, 2008 at 11:39 AM, drflxms <[EM

Re: [R] Free SQL Database with R

2008-09-03 Thread drflxms
Hello Chibisi, I am not shore whether I completely understand your needs: Do you want to build a webpage which relies on a content management system (cms)? Do you want to collect data (i.e. survey) which later on shall be analysed using R? Or shall it be a webpage with an interactive R GUI? What e

Re: [R] convenient way to calculate specificity, sensitivity and accuracy from raw data

2008-09-02 Thread drflxms
0 0 0 0 0 0 0"), > header = TRUE) > closeAllConnections() > > goldstand <- dat$X21 > prev <- sum(goldstand) > cprev <- sum(!goldstand) > n <- prev + cprev > lapply(dat[-1], function(x){ > tab <- table(x, goldstand) > cS <- colSums(tab

[R] convenient way to calculate specificity, sensitivity and accuracy from raw data

2008-09-01 Thread drflxms
Dear R-colleagues, this is a question from a R-newbie medical doctor: I am evaluating data on inter-observer-reliability in endoscopy. 20 medical doctors judged 42 videos filling out a multiple choice survey for each video. The overall-data is organized in a classical way: observations (items fro

Re: [R] simple generation of artificial data with defined features

2008-08-24 Thread drflxms
Hello all, beside saying again thank you for your help, I'd like to present the final solution of my problem and the results of the kappa-calculation: > election.2005 <- c(16194,13136,3494,3838,4648,4118) #data obtained via genesis-database of "Statistisches Bundesamt" www.destatis.de #simply cut

Re: [R] simple generation of artificial data with defined features

2008-08-24 Thread drflxms
Hi Christoph, perfect! Your code worked out of the box (copy and paste ;-). I had expected at least some lines of code, but this is really easy! So once you get used to command line, this is much more flexible (and comfortable!) than all these coloured windows. Can't tell you how happy I am, that

Re: [R] simple generation of artificial data with defined features

2008-08-23 Thread drflxms
ods" section. Thank you again very much for your tips and the quick reply. Have a nice weekend! Greetings from Munich, Felix Mueller-Sarnowski >> -Original Message- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of drflxms >> Sent: Friday, Au

Re: [R] simple generation of artificial data with defined features

2008-08-23 Thread drflxms
onding frequencies to yield the expanded dataset that conforms with > the original table. > > >> bw.dt.exp <- bw.dt[rep(1:nrow(bw.dt), bw.dt$Freq), -ncol(bw.dt)] >> dim(bw.dt.exp) >> > [1] 200 2 > >> table(bw.dt.exp) >> > Var2 &g

[R] simple generation of artificial data with defined features

2008-08-22 Thread drflxms
Dear R-colleagues, I am quite a newbie to R fighting my stupidity to solve a probably quite simple problem of generating artificial data with defined features. I am conducting a study of inter-observer-agreement in child-bronchoscopy. One of the most important measures is Kappa according to Fleis