[R] Proportion of 1's in terminal nodes of CTREE()

2016-05-26 Thread Preetam Pal
Hi R-users, I have created a Conditional Tree using the ctree function ( in package partykit). The data had a factor - the y variable - and a host of categorical x-variables. Now, I want to find the proportion of cases where y = 1 in each of the terminal nodes. Is it possible to do so programmat

Re: [R] Proportion of equal entries in dist()?

2015-01-20 Thread Henrik Bengtsson
On Mon, Jan 19, 2015 at 5:38 AM, Jorge I Velez wrote: > Dear all, > > Given vectors "x" and "y", I would like to compute the proportion of > entries that are equal, that is, mean(x == y). > > Now, suppose I have the following matrix: > > n <- 1e2 > m <- 1e4 > X <- matrix(sample(0:2, m*n, replace =

Re: [R] Proportion of equal entries in dist()?

2015-01-20 Thread Bert Gunter
... (just a comment) and since this appears to be O(m^2 x n), where m,n are the number of rows and columns (correction requested if I got this wrong), it would appear that some basically C level functionality -- perhaps the one Jean suggested? -- would be required for even moderately "large" matr

Re: [R] Proportion of equal entries in dist()?

2015-01-20 Thread Adams, Jean
Jorge, I have not used it myself, but you might find the dist() function in the proxy package to be useful. http://cran.r-project.org/web/packages/proxy/index.html Jean On Mon, Jan 19, 2015 at 7:38 AM, Jorge I Velez wrote: > Dear all, > > Given vectors "x" and "y", I would like to compute the

[R] Proportion of equal entries in dist()?

2015-01-19 Thread Jorge I Velez
Dear all, Given vectors "x" and "y", I would like to compute the proportion of entries that are equal, that is, mean(x == y). Now, suppose I have the following matrix: n <- 1e2 m <- 1e4 X <- matrix(sample(0:2, m*n, replace = TRUE), ncol = m) I am interested in calculating the above proportion f

Re: [R] Proportion data GAM

2014-10-15 Thread Rodrigo Tardin
Thanks Simon! That worked! I did not constrain my k as you suggested, but when I saw my results, my degrees of freedom are not larger than 1, the REML is negative and all covariates are not significant (what it does not make sense). Is there something wrong? Here's the results of summary (a2) Fa

Re: [R] Proportion data GAM

2014-10-15 Thread Rodrigo Tardin
Hi Simon, The result of sessionInfo() is: R version 3.1.0 (2014-04-10) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 [3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C [5] LC_TIME=Portuguese_Brazil.1252 attached base pac

Re: [R] Proportion data GAM

2014-10-15 Thread Simon Wood
Rodrigo, OK, it looks as if your mgcv help files/manual are somehow out of sync with the package version you have loaded. 'betar' is only available from mgcv 1.8. If you update to the current mgcv from CRAN then this problem should be solved. best, Simon ps. beta regression is only availabl

Re: [R] Proportion data GAM

2014-10-15 Thread Simon Wood
Can you give the result of typing sessionInfo() in the session where this happens, please? On 15/10/14 16:48, Rodrigo Tardin wrote: Hi all, I am not sure if this is the right place for this question or if there is one more specific. Anyway, I hope somebody can help me. I am trying to run a GAM

[R] Proportion data GAM

2014-10-15 Thread Rodrigo Tardin
Hi all, I am not sure if this is the right place for this question or if there is one more specific. Anyway, I hope somebody can help me. I am trying to run a GAM with beta distribution from mgcv package. My dependent variable is a proportion continuously ranging from 0 to 1 (whales density) and

[R] proportion explained by each term in a GAM

2011-06-16 Thread Samuel Turgeon
Dear list, I have read several posts on this topic. I would use the same methodology as proposed by Simon Wood in this post: http://r.789695.n4.nabble.com/variance-explained-by-each-term-in-a-GAM-td836513.html My first question is: Does anyone know a scientific source (paper, book,...) that exp

Re: [R] proportion

2010-09-14 Thread Greg Snow
rom: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of LCOG1 > Sent: Monday, September 13, 2010 4:53 PM > To: r-help@r-project.org > Subject: [R] proportion > > > Hi , > SO i have been on a role of asking simple questions lately. So much &

Re: [R] proportion

2010-09-13 Thread ROLL Josh F
ubject: Re: [R] proportion Maybe prop.table ? - Phil Spector Statistical Computing Facility Department of Statistics U

Re: [R] proportion

2010-09-13 Thread Phil Spector
Maybe prop.table ? - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

[R] proportion

2010-09-13 Thread LCOG1
Hi , SO i have been on a role of asking simple questions lately. So much for feeling like im getting this R business. I wrote a script 2 weeks ago that utilized "proportion" to turn values in a table (from "table") into proportions to then graph. I now get an error that proportion is not a

Re: [R] proportion of treatment effect by a surrogate (fitting multivariate survival model)

2010-05-18 Thread Vinh Nguyen
On Mon, May 17, 2010 at 7:42 PM, Vinh Nguyen wrote: > Dear R-help, > > I would like to compute the variance for the proportion of treatment > effect by a surrogate in a survival model (Lin, Fleming, and De > Gruttola 1997 in Statistics in Medicine).  The paper mentioned that > the covariance matri

[R] proportion of treatment effect by a surrogate (fitting multivariate survival model)

2010-05-17 Thread Vinh Nguyen
Dear R-help, I would like to compute the variance for the proportion of treatment effect by a surrogate in a survival model (Lin, Fleming, and De Gruttola 1997 in Statistics in Medicine). The paper mentioned that the covariance matrix matches that of the covariance matrix estimator for the margin