Re: [R] test logistic regression model

2022-11-20 Thread Mitchell Maltenfort
ries, or present both and highlight the difference in outcome. A > third option is to gather more data. > > Tim > > -Original Message- > From: R-help On Behalf Of Bert Gunter > Sent: Sunday, November 20, 2022 1:06 PM > To: Mitchell Maltenfort > Cc: R-help > Subject: R

Re: [R] test logistic regression model

2022-11-20 Thread Ebert,Timothy Aaron
- From: R-help On Behalf Of Bert Gunter Sent: Sunday, November 20, 2022 1:06 PM To: Mitchell Maltenfort Cc: R-help Subject: Re: [R] test logistic regression model [External Email] I think (2) might be a bad idea if one of the "sparse"categories has high predictive power. You'll lose i

Re: [R] test logistic regression model

2022-11-20 Thread Bert Gunter
I think (2) might be a bad idea if one of the "sparse"categories has high predictive power. You'll lose it when you pool, will you not? Also, there is the problem of subjectively defining "sparse." However, 1) seems quite sensible to me. But IANAE. -- Bert On Sun, Nov 20, 2022 at 9:49 AM

Re: [R] test logistic regression model

2022-11-20 Thread Mitchell Maltenfort
Two possible fixes occur to me 1) Redo the test/training split but within levels of factor - so you have the same split within each level and each level accounted for in training and testing 2) if you have a lot of levels, and perhaps sparse representation in a few, consider recoding levels to

Re: [R] test logistic regression model

2022-11-20 Thread Bert Gunter
small reprex: set.seed(5) dat <- data.frame(f = rep(c('r','g'),4), y = runif(8)) newdat <- data.frame(f =rep(c('r','g','b'),2)) ## convert values in newdat not seen in dat to NA is.na(newdat$f) <-!( newdat$f %in% dat$f) lmfit <- lm(y~f, data = dat) ##Result: > predict(lmfit,newdat) 1

Re: [R] test logistic regression model

2022-11-20 Thread Rui Barradas
Às 15:29 de 20/11/2022, Gábor Malomsoki escreveu: Dear Bert, Yes, was trying to fill the not existing categories with NAs, but the suggested solutions in stackoverflow.com unfortunately did not work. Best regards Gabor Bert Gunter schrieb am So., 20. Nov. 2022, 16:20: You can't predict

Re: [R] test logistic regression model

2022-11-20 Thread Gábor Malomsoki
Dear Bert, Yes, was trying to fill the not existing categories with NAs, but the suggested solutions in stackoverflow.com unfortunately did not work. Best regards Gabor Bert Gunter schrieb am So., 20. Nov. 2022, 16:20: > You can't predict results for categories that you've not seen before >

Re: [R] test logistic regression model

2022-11-20 Thread Bert Gunter
You can't predict results for categories that you've not seen before (think about it). You will need to remove those cases from your test set (or convert them to NA and predict them as NA). -- Bert On Sun, Nov 20, 2022 at 7:02 AM Gábor Malomsoki wrote: > Dear all, > > i have created a logistic

[R] test logistic regression model

2022-11-20 Thread Gábor Malomsoki
Dear all, i have created a logistic regression model, on the train df: mymodel1 <- glm(book_state ~ TG_KraftF5, data = train, family = "binomial") then i try to predict with the test df Predict<- predict(mymodel1, newdata = test, type = "response") then iget this error message: Error in

Re: [R] Embedded R: Test if initialized

2021-06-16 Thread Bert Gunter
I believe this is the wrong list for this post. See the posting guide, linked below, for one that is more appropriate. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip

[R] Embedded R: Test if initialized

2021-06-16 Thread Matthias Gondan
Dear R friends, I am currently trying to write a piece of C code that uses „embedded R“, and for specific reasons*, I cannot keep track if R already has been initialized. So the code snippet looks like this: LibExtern char *R_TempDir; if(R_TempDir == NULL) …throw exception R not

Re: [R] test if something was plotted on pdf device

2019-09-13 Thread PIKAL Petr
er it is finished to pdf. The only obstacle is that my code flashes during plotting to basic device, however I can live with it. Thank you again and best regards Petr > -Original Message- > From: Duncan Murdoch > Sent: Thursday, September 12, 2019 2:29 PM > To: PIKAL Petr

Re: [R] test if something was plotted on pdf device

2019-09-12 Thread Duncan Murdoch
On 12/09/2019 7:10 a.m., PIKAL Petr wrote: Dear all Is there any simple way checking whether after calling pdf device something was plotted into it? In interactive session I used if (dev.cur()==1) plot(ecdf(rnorm(100))) else plot(ecdf(rnorm(100)), add=T, col=i) which enabled me to test if

[R] test if something was plotted on pdf device

2019-09-12 Thread PIKAL Petr
Dear all Is there any simple way checking whether after calling pdf device something was plotted into it? In interactive session I used if (dev.cur()==1) plot(ecdf(rnorm(100))) else plot(ecdf(rnorm(100)), add=T, col=i) which enabled me to test if plot is open But when I want to call eg.

Re: [R] test of independence

2018-12-20 Thread Greg Snow
The basic test of independence for a table based on the Chi-squared distribution can be done using the `chisq.test` function. This is in the stats package which is installed and loaded by default, so you don't need to do anything additional. There is also the `fisher.test` function for Fisher's

Re: [R] test of independence

2018-12-20 Thread PIKAL Petr
Hi Did you search CRAN? I got **many** results for test of independence which may or may not provide you with suitable procedures. Cheers Petr > -Original Message- > From: R-help On Behalf Of km > Sent: Thursday, December 20, 2018 8:07 AM > To: r-help@r-project.org &

[R] test of independence

2018-12-19 Thread km
Dear All, How do I do a test of independence with 16x16 table of counts. Please suggest. Regards, KM [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] TEST message

2018-04-24 Thread Ted Harding
Apologies for disturbance! Just checking that I can get through to r-help. Ted. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Test if data uniformly distributed (newbie)

2018-04-10 Thread Huber, Florian
Dear Mr. Savicky, I am currently working on a project where I want to test a random number generator, which is supposed to create 10.000 continuously uniformly distributed random numbers between 0 and 1. I am now wondering if I can use the Chi-Squared-Test to solve this problem or if the

[R] Test set and Train set in Caret package train function

2017-10-22 Thread Elahe chalabi via R-help
Hey all, Does anyone know how we can get train set and test set for each fold of 5 fold cross validation in Caret package? Imagine if I want to do cross validation by random forest method, I do the following in Caret: set.seed(12) train_control <- trainControl(method="cv",

Re: [R] test for proportion or concordance

2017-08-03 Thread Bert Gunter
This list is about R programming, not statistics, although admittedly there is a nonempty intersection. However, I think you would do better posting this on a statistics list like stats.stackexchange.com. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming

[R] test for proportion or concordance

2017-08-03 Thread Adrian Johnson
Hello group, my question is deciding what test would be appropriate for following question. An experiment 'A' yielded 3200 observations of which 431 are significant. Similarly, using same method, another experiment 'B' on a different population yielded 2541 observations of which 260 are

Re: [R] Test individual slope for each factor level in ANCOVA

2017-03-16 Thread li li
Hi John. Thanks much for your help. It is great to know this. Hanna 2017-03-16 8:02 GMT-04:00 Fox, John : > Dear Hanna, > > You can test the slope in each non-reference group as a linear hypothesis. > You didn’t make the data available for your example, so here’s an example >

Re: [R] Test individual slope for each factor level in ANCOVA

2017-03-16 Thread Fox, John
Dear Hanna, You can test the slope in each non-reference group as a linear hypothesis. You didn’t make the data available for your example, so here’s an example using the linearHypothesis() function in the car package with the Moore data set in the same package: - - - snip - - - > library(car)

[R] Test individual slope for each factor level in ANCOVA

2017-03-15 Thread li li
Hi all, Consider the data set where there are a continuous response variable, a continuous predictor "weeks" and a categorical variable "region" with five levels "a", "b", "c", "d", "e". I fit the ANCOVA model as follows. Here the reference level is region "a" and there are 4 dummy variables.

[R] Test

2017-01-16 Thread Robert Piliero
-- Robert J. Piliero Cell: (617) 283 1020 38 Linnaean St. #6 Cambridge, MA, 02138 USA [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Test for Homoscedesticity in R Without BP Test

2016-04-04 Thread Deepak Singh
r interactions mentioned > above. > > So the bptest() implementation from "lmtest" is really recommend. Or > alternatively ncvTest() from package "car". > > > Hope this helps. >> >> Sacha >> >> >> >> >> >> __

Re: [R] Test for Homoscedesticity in R Without BP Test

2016-04-04 Thread Achim Zeileis
) implementation from "lmtest" is really recommend. Or alternatively ncvTest() from package "car". Hope this helps. Sacha De : Deepak Singh <sdeepakrh...@gmail.com> À : r-help@r-project.org Envoyé le : Lundi 4 avril 2016 10h40 Objet :

Re: [R] Test for Homoscedesticity in R Without BP Test

2016-04-04 Thread Achim Zeileis
On Mon, 4 Apr 2016, Deepak Singh wrote: Respected Sir, I am doing a project on multiple linear model fitting and in that project I have to test Homoscedesticity of errors I have google for the same and found bptest for the same but in R version 3.2.4 bp test is not available. The function is

Re: [R] Test for Homoscedesticity in R Without BP Test

2016-04-04 Thread varin sacha via R-help
the assumption of heteroscedastic. The White test with R install.packages("bstats") library(bstats) white.test(LinearModel) Hope this helps. Sacha De : Deepak Singh <sdeepakrh...@gmail.com> À : r-help@r-project.org Envoyé le : Lundi 4 avril 2016

Re: [R] Test for Homoscedesticity in R Without BP Test

2016-04-04 Thread John C Frain
You might "google Breusch Pagan test r" and find that the test is implemented in lmtest package. On 4 Apr 2016 17:28, "Deepak Singh" wrote: > Respected Sir, > I am doing a project on multiple linear model fitting and in that project I > have to test Homoscedesticity of

[R] Test for Homoscedesticity in R Without BP Test

2016-04-04 Thread Deepak Singh
Respected Sir, I am doing a project on multiple linear model fitting and in that project I have to test Homoscedesticity of errors I have google for the same and found bptest for the same but in R version 3.2.4 bp test is not available. So please suggest me a test on homoscedesticity ASAP as we

Re: [R] test hypothesis in R

2016-03-23 Thread David Winsemius
> On Mar 23, 2016, at 1:44 PM, ruipbarra...@sapo.pt wrote: > > Hello, > > Try > > ?t.test > t.test(mA, mB, alternative = "greater") > > Hope this helps, > > Rui Barradas > > > Citando Eliza Botto : > >> Dear All, >> I want to test a hypothesis in R by using

Re: [R] test hypothesis in R

2016-03-23 Thread ruipbarradas
othesis is that model A produced less error. >   > regards, >   > Eliza >   > - > Date: Wed, 23 Mar 2016 20:44:20 + > From: ruipbarra...@sapo.pt > To: eliza_bo...@outlook.com > CC: r-help@r-project.org > Subject: Re: [R] test hypothesis in

Re: [R] test hypothesis in R

2016-03-23 Thread Eliza Botto
Thnx Rui, Just one point though Should it be alternative="greater" or "less"? Since alternative hypothesis is that model A produced less error. regards, Eliza Date: Wed, 23 Mar 2016 20:44:20 + From: ruipbarra...@sapo.pt To: eliza_bo...@outlook.com CC: r-help@r-project

Re: [R] test hypothesis in R

2016-03-23 Thread ruipbarradas
Hello, Try ?t.test t.test(mA, mB, alternative = "greater") Hope this helps, Rui Barradas   Citando Eliza Botto : > Dear All, > I want to test a hypothesis in R by using student' t-test (P-values). > The hypothesis is that model A produces lesser error than model B at

[R] test hypothesis in R

2016-03-23 Thread Eliza Botto
Dear All, I want to test a hypothesis in R by using student' t-test (P-values). The hypothesis is that model A produces lesser error than model B at ten stations. Obviously, Null Hypothesis (H0) is that the error produces by model A is not lower than model B. The error magnitudes are #model A

Re: [R] test if a url exists

2014-06-29 Thread Duncan Murdoch
On 29/06/2014, 7:12 AM, Hui Du wrote: Hi all, I need to test if a url exists. I used url.exists() in RCurl package library(RCurl) however the test result is kind of weird. For example, url.exists(http://www.amazon.com;) [1] FALSE although www.amazon.comhttp://www.amazon.com is a

[R] test if a url exists

2014-06-28 Thread Hui Du
Hi all, I need to test if a url exists. I used url.exists() in RCurl package library(RCurl) however the test result is kind of weird. For example, url.exists(http://www.amazon.com;) [1] FALSE although www.amazon.comhttp://www.amazon.com is a valid url. Does anybody know how to use that

Re: [R] test the return from grep or agrep

2014-03-02 Thread Prof Brian Ripley
On 01/03/2014 23:32, Hui Du wrote: Hi All, My sample code looks like options(stringsAsFactors = FALSE); clean = function(x) { loc = agrep(ABC, x$name); x[loc,]$new_name - NEW; x; } name = c(12, dad, dfd); y = data.frame(name = as.character(name), idx = 1:3); y$new_name =

[R] test the return from grep or agrep

2014-03-01 Thread Hui Du
Hi All, My sample code looks like options(stringsAsFactors = FALSE); clean = function(x) { loc = agrep(ABC, x$name); x[loc,]$new_name - NEW; x; } name = c(12, dad, dfd); y = data.frame(name = as.character(name), idx = 1:3); y$new_name = y$name; z - clean(y) The snippet does not

[R] Test to determine if there is a difference between two means

2013-12-24 Thread wesley bell
Hi, I have a data set where there are 20 experiments which each ran for 10 minutes. In each experiment an insect had a choice to spend time in one of two chambers. Each experiment therefore has number of seconds spent in each chamber. I want to know whether there is a difference in the mean

Re: [R] Test to determine if there is a difference between two means

2013-12-24 Thread Bert Gunter
Inline below. Cheers, Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. H. Gilbert Welch On Tue, Dec 24, 2013 at 7:38 AM, wesley bell wesleybel...@yahoo.com wrote: Hi, I have a data

[R] Test ADF differences in R and Eviews

2013-12-05 Thread nooldor
Hi, In attachment you can find source data on which I run adf.test() and print-screen with results in R and Eviews. Results are very different. Did I missed something? Best, T.S. __ R-help@r-project.org mailing list

Re: [R] Test ADF differences in R and Eviews

2013-12-05 Thread David Winsemius
On Dec 5, 2013, at 3:18 PM, nooldor wrote: Hi, In attachment you can find source data on which I run adf.test() and print-screen with results in R and Eviews. Results are very different. Did I missed something? Yes. You missed the list of acceptable file types for r-help. -- David

[R] Test for exogeneity

2013-11-11 Thread jpm miao
Hi, I am building a bivariate SVAR model y_1t=c_1+Ã_1 (1,1) y_(1,t-1)+Ã_1 (1,2) y_(2,t-1)+Ã_2 (1,1) y_(1,t-2)+Ã_2 (1,2) y_(2,t-2)+å_1t b y_1t+ y_2t=c_2+Ã_1 (2,1) y_(1,t-1)+Ã_1 (2,2) y_(2,t-1)+Ã_2 (2,1) y_(1,t-2)+Ã_2 (1,2) y_(2,t-2)+å_2t Now y1 is relatively exogenous in that y1

Re: [R] test wilcoxon sur R help!

2013-10-24 Thread arun
Hi, Try: fun1 - function(dat){ mat1 - combn(colnames(dat1),2)  res - sapply(seq_len(ncol(mat1)),function(i) {x1- dat[,mat1[,i]]; wilcox.test(x1[,1],x1[,2])$p.value}) names(res) - apply(mat1,2,paste,collapse=_) res } set.seed(432) dat1 -

Re: [R] test wilcoxon sur R help!

2013-10-24 Thread Rui Barradas
Hello, There's a bug in your function, it should be 'dat', not 'dat1'. In the line marked, below. fun1 - function(dat){ mat1 - combn(colnames(dat),2) # Here, 'dat' not 'dat1' res - sapply(seq_len(ncol(mat1)),function(i) {x1- dat[,mat1[,i]]; wilcox.test(x1[,1],x1[,2])$p.value})

Re: [R] test wilcoxon sur R help!

2013-10-24 Thread vikram ranga
Hi, Check out this function:- pairwise.wilcox.test {package=stats}. example(pairwise.wilcox.test) On Fri, Oct 25, 2013 at 2:15 AM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, There's a bug in your function, it should be 'dat', not 'dat1'. In the line marked, below. fun1 -

Re: [R] test wilcoxon sur R help!

2013-10-24 Thread arun
It looks much better than mine. with p value adjustment: p.adjust(fun1(dat1), method = holm, n = 153) # dat1$id - 1:10 library(reshape2) dat2 - melt(dat1,id.var=id) with(dat2,pairwise.wilcox.test(value,variable))  with(dat2,pairwise.wilcox.test(value,variable,p.adj=none)) A.K. On

[R] Test if 2 samples differ if they have autocorrelation

2013-07-18 Thread Eric Jaeger
Dear all I have one question that I struggle to find an answer: Let`s assume I have 2 timeseries of daily PnL data over 2 years coming from 2 different trading strategies. I want to find out if strategy A is better than strategy B. The problem is that the two series have serial

Re: [R] Test if 2 samples differ if they have autocorrelation

2013-07-18 Thread Rolf Turner
I imagine that most readers of this list will put your question in the too hard basket. That being so, here is my inexpert take on the question. The issue is to estimate the uncertainty in the estimated difference of the means. This uncertainty depends on the nature of the serial dependence

Re: [R] Test for column equality across matrices

2013-07-14 Thread Thiem Alrik
] Gesendet: Samstag, 13. Juli 2013 19:57 An: William Dunlap Cc: mailman, r-help; Thiem Alrik Betreff: Re: [R] Test for column equality across matrices I tried it on a slightly bigger dataset: A1 - matrix(t(expand.grid(1:90, 15, 16)), nrow = 3) B1 - combn(90, 3) which(is.element(columnsOf(B1

Re: [R] Test for column equality across matrices

2013-07-14 Thread William Dunlap
Dunlap Cc: R help; Thiem Alrik Subject: Re: [R] Test for column equality across matrices I tried it on a slightly bigger dataset: A1 - matrix(t(expand.grid(1:90, 15, 16)), nrow = 3) B1 - combn(90, 3) which(is.element(columnsOf(B1), columnsOf(A1))) # [1]  1067  4895  8636 12291 15861 19347

[R] Test for column equality across matrices

2013-07-13 Thread Thiem Alrik
Dear list, I have two matrices A - matrix(t(expand.grid(c(1,2,3,4,5), 15, 16)), nrow = 3) B - combn(16, 3) Now I would like to exclude all columns from the 560 columns in B which are identical to any 1 of the 6 columns in A. How could I do this? Many thanks and best wishes, Alrik

Re: [R] Test for column equality across matrices

2013-07-13 Thread William Dunlap
Sent: Saturday, July 13, 2013 6:45 AM To: mailman, r-help Subject: [R] Test for column equality across matrices Dear list, I have two matrices A - matrix(t(expand.grid(c(1,2,3,4,5), 15, 16)), nrow = 3) B - combn(16, 3) Now I would like to exclude all columns from the 560 columns in B

Re: [R] Test for column equality across matrices

2013-07-13 Thread arun
. - Original Message - From: William Dunlap wdun...@tibco.com To: Thiem Alrik th...@sipo.gess.ethz.ch; mailman, r-help r-help@r-project.org Cc: Sent: Saturday, July 13, 2013 1:30 PM Subject: Re: [R] Test for column equality across matrices Try   columnsOf - function(mat) split(mat, col(mat))   newB

Re: [R] Test for column equality across matrices

2013-07-13 Thread arun
(match(interaction(as.data.frame(t(B))),interaction(as.data.frame(t(A)]  identical(B1,B2) #[1] TRUE A.K. - Original Message - From: Thiem Alrik th...@sipo.gess.ethz.ch To: mailman, r-help r-help@r-project.org Cc: Sent: Saturday, July 13, 2013 9:45 AM Subject: [R] Test for column

[R] test

2013-04-01 Thread catalin roibu
Sorry for this message it's just a test. Thank you! -- --- Catalin-Constantin ROIBU Lecturer PhD, Forestry engineer Forestry Faculty of Suceava Str. Universitatii no. 13, Suceava, 720229, Romania office phone +4 0230 52 29 78, ext. 531 mobile phone +4 0745 53 18 01

Re: [R] Test of Parallel Regression Assumption in R

2013-03-12 Thread Rune Haubo
Dear Heather, You can make this test using the ordinal package. Here the function clm fits cumulative link models where the ordinal logistic regression model is a special case (using the logit link). Let me illustrate how to test the parallel regression assumption for a particular variable using

[R] Test of Parallel Regression Assumption in R

2013-03-11 Thread Heather Kettrey
Hi, I am running an analysis with an ordinal outcome and I need to run a test of the parallel regression assumption to determine if ordinal logistic regression is appropriate. I cannot find a function to conduct such a test. From searching various message boards I have seen a few useRs ask this

Re: [R] Test of Parallel Regression Assumption in R

2013-03-11 Thread Bert Gunter
Heather: You are at Vanderbilt, whose statistics department under Frank Harrell is a veritable bastion of R and statistical wisdom. I strongly recommend that you take a stroll over there in the lovely spring weather and seek their help. I can't imagine how you could do better than that! Cheers,

Re: [R] Test of Parallel Regression Assumption in R

2013-03-11 Thread Jeff Newmiller
Perhaps you should be asking whether such an algorithm exists, regardless of whether it is already implemented in R. However, this is the wrong place to ask such theory questions... your local statistics expert might know, or you could ask on a statistics theory forum such as

Re: [R] Test of Parallel Regression Assumption in R

2013-03-11 Thread Nicole Ford
here's some code as an example hope it helps! mod-polr(vote~age+demsat+eusup+lrself+male+retnat+union+urban, data=dat) summary(mod) mod-polr(vote~age+demsat+eusup+lrself+male+retnat+union+urban, data=dat) levs-levels(dat$vote) tmpdat-list() for(i in 1:(nlevels(dat$vote)-1)){ tmpdat[[i]] -

[R] Test if mysql connection is alive

2013-02-14 Thread Frans Marcelissen
Hi fellows, I use RMySQL. I want to reconnect, if the connections is not alive anymore. if (!connected()) con-dbConnect(MySQL(),user=.., password=..,host=..,db=..) But how can I do the test connected()? I thought the way to do this was,

Re: [R] test for a condition in a vector for loop not working

2012-11-10 Thread scoyoc
Once again, thanks! MVS - MVS = Matthew Van Scoyoc Graduate Research Assistant, Ecology Wildland Resources Department Ecology Center Quinney College of Natural Resources Utah State University Logan, UT = Think SNOW! -- View this message in context:

[R] Test for treatment effect in a logistic regression

2012-10-16 Thread bibek sharma
Dear R usuer, I need to fit logistic regression with binomial response. The objective is to compare treatment groups controlling other categorical and continuous predictors. The GLM procedure with family=binomial(Logit) gives me parameters estimates as well as odd ratios. But objective is to

Re: [R] Test for Random Points on a Sphere

2012-10-07 Thread 周果
Hi Lorenzo, Just a quick thought, the uniform probability density on a unit sphere is 1 / (4pi), what about binning those random points according to their directions and do a chi-square test? Regards, Guo On Sun, Oct 7, 2012 at 2:16 AM, cbe...@tajo.ucsd.edu wrote: Lorenzo Isella

Re: [R] Test for Random Points on a Sphere

2012-10-06 Thread cberry
Lorenzo Isella lorenzo.ise...@gmail.com writes: Dear All, I implemented an algorithm for (uniform) random rotations. In order to test it, I can apply it to a unit vector (0,0,1) in Cartesian coordinates. The result is supposed to be a set of random, uniformly distributed, points on a sphere

[R] Test for Random Points on a Sphere

2012-10-05 Thread Lorenzo Isella
Dear All, I implemented an algorithm for (uniform) random rotations. In order to test it, I can apply it to a unit vector (0,0,1) in Cartesian coordinates. The result is supposed to be a set of random, uniformly distributed, points on a sphere (not the point of the algorithm, but a way to

Re: [R] Test for Random Points on a Sphere

2012-10-05 Thread R. Michael Weylandt
On Fri, Oct 5, 2012 at 5:39 PM, Lorenzo Isella lorenzo.ise...@gmail.com wrote: Dear All, I implemented an algorithm for (uniform) random rotations. In order to test it, I can apply it to a unit vector (0,0,1) in Cartesian coordinates. The result is supposed to be a set of random, uniformly

Re: [R] Test for Random Points on a Sphere

2012-10-05 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of R. Michael Weylandt Sent: Friday, October 05, 2012 11:17 AM To: Lorenzo Isella Cc: r-help@r-project.org Subject: Re: [R] Test for Random Points on a Sphere On Fri, Oct 5

[R] test Breslow-Day for svytable??

2012-08-31 Thread Diana Marcela Martinez Ruiz
Hi all, I want to know how to perform the test Breslow-Day test for homogeneity of odds ratios (OR) stratified for svytable. This test is obtained with the following code: epi.2by2 (dat = daty, method = case.control conf.level = 0.95, units = 100, homogeneity = breslow.day, verbose =

Re: [R] test Breslow-Day for svytable??

2012-08-31 Thread John Sorkin
Suggstion: You need to send us more information, i.e. the code that genrated daty, or a listing of the daty structure, and a copy of the listing produced by epi.2by2 John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of

Re: [R] test Breslow-Day for svytable??

2012-08-31 Thread David Winsemius
On Aug 31, 2012, at 7:20 AM, Diana Marcela Martinez Ruiz wrote: Hi all, I want to know how to perform the test Breslow-Day test for homogeneity of odds ratios (OR) stratified for svytable. This test is obtained with the following code: epi.2by2 (dat = daty, method = case.control

Re: [R] test Breslow-Day for svytable??

2012-08-31 Thread Thomas Lumley
On Sat, Sep 1, 2012 at 4:27 AM, David Winsemius dwinsem...@comcast.net wrote: On Aug 31, 2012, at 7:20 AM, Diana Marcela Martinez Ruiz wrote: Hi all, I want to know how to perform the test Breslow-Day test for homogeneity of odds ratios (OR) stratified for svytable. This test is obtained

Re: [R] test if elements of a character vector contain letters

2012-08-08 Thread Liviu Andronic
On Tue, Aug 7, 2012 at 10:26 PM, Marc Schwartz marc_schwa...@me.com wrote: since there are alpha-numerics present, whereas the first option will: grepl([^[:alnum:]], ab%) [1] TRUE So, use the first option. And I should start reading more carefully. The above works fine for me. I ended up

Re: [R] test if elements of a character vector contain letters

2012-08-07 Thread Liviu Andronic
On Mon, Aug 6, 2012 at 7:35 PM, Marc Schwartz marc_schwa...@me.com wrote: is.letter - function(x) grepl([[:alpha:]], x) is.number - function(x) grepl([[:digit:]], x) Quick follow-up question. I'm always reluctant to create functions that would resemble the method of a function (here, is() ),

Re: [R] test if elements of a character vector contain letters

2012-08-07 Thread Liviu Andronic
On Mon, Aug 6, 2012 at 7:35 PM, Marc Schwartz marc_schwa...@me.com wrote: is.letter - function(x) grepl([[:alpha:]], x) is.number - function(x) grepl([[:digit:]], x) Another follow-up. To test for (non-)alphanumeric one would do the following: x - c(letters, 1:26, '+', '-', '%^') x[1:10] -

Re: [R] test if elements of a character vector contain letters

2012-08-07 Thread R. Michael Weylandt
On Tue, Aug 7, 2012 at 4:28 AM, Liviu Andronic landronim...@gmail.com wrote: On Mon, Aug 6, 2012 at 7:35 PM, Marc Schwartz marc_schwa...@me.com wrote: is.letter - function(x) grepl([[:alpha:]], x) is.number - function(x) grepl([[:digit:]], x) Quick follow-up question. I'm always reluctant

Re: [R] test if elements of a character vector contain letters

2012-08-07 Thread Marc Schwartz
On Aug 7, 2012, at 3:02 PM, Liviu Andronic landronim...@gmail.com wrote: On Mon, Aug 6, 2012 at 7:35 PM, Marc Schwartz marc_schwa...@me.com wrote: is.letter - function(x) grepl([[:alpha:]], x) is.number - function(x) grepl([[:digit:]], x) Another follow-up. To test for (non-)alphanumeric

Re: [R] test if elements of a character vector contain letters

2012-08-07 Thread Marc Schwartz
On Aug 7, 2012, at 3:18 PM, Marc Schwartz marc_schwa...@me.com wrote: On Aug 7, 2012, at 3:02 PM, Liviu Andronic landronim...@gmail.com wrote: On Mon, Aug 6, 2012 at 7:35 PM, Marc Schwartz marc_schwa...@me.com wrote: is.letter - function(x) grepl([[:alpha:]], x) is.number - function(x)

Re: [R] test if elements of a character vector contain letters

2012-08-07 Thread Liviu Andronic
On Tue, Aug 7, 2012 at 10:18 PM, Marc Schwartz marc_schwa...@me.com wrote: That will get you values where punctuation characters are used, but there may be other non-alphanumeric characters in the vector. There may be ASCII control codes, tabs, newlines, CR, LF, spaces, etc. which would not

[R] test if elements of a character vector contain letters

2012-08-06 Thread Liviu Andronic
Dear all I'm pretty sure that I'm approaching the problem in a wrong way. Suppose the following character vector: (x[1:10] - paste(x[1:10], sample(1:10, 10), sep='')) [1] a10 b7 c2 d3 e6 f1 g5 h8 i9 j4 x [1] a10 b7 c2 d3 e6 f1 g5 h8 i9 j4 k l m n [15] o p q r s t

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread Bert Gunter
nzchar(x) !is.na(x) No? -- Bert On Mon, Aug 6, 2012 at 9:25 AM, Liviu Andronic landronim...@gmail.com wrote: Dear all I'm pretty sure that I'm approaching the problem in a wrong way. Suppose the following character vector: (x[1:10] - paste(x[1:10], sample(1:10, 10), sep='')) [1] a10 b7

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread Rui Barradas
Hello, Fun as an exercise in vectorization. 30 times faster. Don't look, guess. Gave it up? Ok, here it is. is_letter - function(x, pattern=c(letters, LETTERS)){ sapply(x, function(y){ any(sapply(pattern, function(z) grepl(z, y, fixed=T))) }) } # test ascii codes, just one

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread Martin Morgan
On 08/06/2012 09:51 AM, Rui Barradas wrote: Hello, Fun as an exercise in vectorization. 30 times faster. Don't look, guess. system.time(res0 - grepl([[:alpha:]], x)) user system elapsed 0.060 0.000 0.061 system.time(res1 - has_letter(x)) user system elapsed 3.728 0.008

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread Marc Schwartz
Perhaps I am missing something, but why use sapply() when grepl() is already vectorized? is.letter - function(x) grepl([:alpha:], x) is.number - function(x) grepl([:digit:], x) x - c(letters, 1:26) x[1:10] - paste(x[1:10], sample(1:10, 10), sep='') x - rep(x, 1e3) str(x) chr [1:52000] a2

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread arun
, 2012 12:25 PM Subject: [R] test if elements of a character vector contain letters Dear all I'm pretty sure that I'm approaching the problem in a wrong way. Suppose the following character vector: (x[1:10] - paste(x[1:10], sample(1:10, 10), sep='')) [1] a10 b7  c2  d3  e6  f1  g5  h8  i9  j4 x [1

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread Marc Schwartz
On Aug 6, 2012, at 12:06 PM, Marc Schwartz marc_schwa...@me.com wrote: Perhaps I am missing something, but why use sapply() when grepl() is already vectorized? is.letter - function(x) grepl([:alpha:], x) is.number - function(x) grepl([:digit:], x) Sorry, typos in the above from my CP.

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread David L Carlson
: Monday, August 06, 2012 12:07 PM To: Rui Barradas Cc: r-help Subject: Re: [R] test if elements of a character vector contain letters Perhaps I am missing something, but why use sapply() when grepl() is already vectorized? is.letter - function(x) grepl([:alpha:], x) is.number - function(x

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread Liviu Andronic
On Mon, Aug 6, 2012 at 6:42 PM, Bert Gunter gunter.ber...@gene.com wrote: nzchar(x) !is.na(x) No? It doesn't work for what I need: x [1] a10 b8 c9 d2 e3 f4 g1 h7 i6 j5 k l m n [15] o p q r s t u v w x y z 1 2 [29] 3 4 5 6 7 8 9 10 11 12

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread Yihui Xie
You probably mean grepl('[a-zA-Z]', x) Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Mon, Aug 6, 2012 at 3:29 PM, Liviu Andronic landronim...@gmail.com wrote: On Mon, Aug

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread Liviu Andronic
On Mon, Aug 6, 2012 at 7:35 PM, Marc Schwartz marc_schwa...@me.com wrote: is.letter - function(x) grepl([[:alpha:]], x) is.number - function(x) grepl([[:digit:]], x) This does exactly what I wanted: x [1] a10 b8 c9 d2 e3 f4 g1 h7 i6 j5 k l m n [15] o p q r s t u v

Re: [R] test parallel slopes with svyolr

2012-07-08 Thread Thomas Lumley
On Sun, Jul 8, 2012 at 2:32 AM, Diana Marcela Martinez Ruiz dianamm...@hotmail.com wrote: Hello, I would like to know how to test the assumption of proportional odds or parallel lines or slopes for an ordinal logistic regression with svyolr I wouldn't, but if someone finds a clear reference

[R] test parallel slopes with svyolr

2012-07-07 Thread Diana Marcela Martinez Ruiz
Hello, I would like to know how to test the assumption of proportional odds or parallel lines or slopes for an ordinal logistic regression with svyolr Thanks [[alternative HTML version deleted]] __

Re: [R] Test Binary File

2012-06-12 Thread Nortisiv
As an alternative to the hexview package, an external Hex-Editor may help you investigate how the data is organised. -- View this message in context: http://r.789695.n4.nabble.com/Test-Binary-File-tp833690p4633075.html Sent from the R help mailing list archive at Nabble.com.

[R] Test if a sample mean of integers with range -inf; inf is different from zero

2012-05-04 Thread Kay Cichini
Hi all, how would you test if a sample mean of integers with range -inf;inf is different from zero: # my sample of integers: c - c(-3, -1, 0, 1, 0, 3, 4, 10, 12) # is mean of c 0?: mean(c) Thanks, Kay [[alternative HTML version deleted]]

Re: [R] Test if a sample mean of integers with range -inf; inf is different from zero

2012-05-04 Thread R. Michael Weylandt
mean(c) != 0 But if you mean in a statistical sense... t.test() is one possibility. Michael On Fri, May 4, 2012 at 5:29 AM, Kay Cichini kay.cich...@gmail.com wrote: Hi all, how would you test  if a sample mean of integers with range -inf;inf  is different from zero: # my sample of

Re: [R] Test if a sample mean of integers with range -inf; inf is different from zero

2012-05-04 Thread Petr Savicky
On Fri, May 04, 2012 at 11:29:51AM +0200, Kay Cichini wrote: Hi all, how would you test if a sample mean of integers with range -inf;inf is different from zero: # my sample of integers: c - c(-3, -1, 0, 1, 0, 3, 4, 10, 12) # is mean of c 0?: mean(c) Hi. It is better to use a name

  1   2   3   >