[R] logistic regression in an incomplete dataset

2010-04-05 Thread Desmond D Campbell
Dear all, I want to do a logistic regression. So far I've only found out how, in a dataset of complete cases. I'd like to do logistic regression via max likelihood, using all the study cases (complete and incomplete). Can you help? I'm using glm() with family=binomial(logit). If any covariate in

Re: [R] Biplot for PCA using labdsv package

2010-04-05 Thread Michael Denslow
Hi Dilys, On Fri, Apr 2, 2010 at 3:08 AM, Dilys Vela dily...@gmail.com wrote: Hi everyone, I am doing PCA with labdsv package. I was trying to create a biplot graphs in order to observe arrows related to my variables. However when I run the script for this graph, the console just keep

[R] Co-occurrence

2010-04-05 Thread mailing-list
Hello together! I was searching through and different R sites, however I did not find any useful site for my problem. Is there any co-occurrence program in R which could work with text strings? Thanks for any help or hint, best regards, Georg __

[R] Creating R packages, passing by reference and oo R.

2010-04-05 Thread Roger Gill
Dear All, I would like some advice on creating R packages, passing by reference and oo R. I have created a package that is neither elegant nor extensible and rather cumbersome (it works). I would like to re write the code to make the package distributable (should it be of interest) and easy to

[R] GLM

2010-04-05 Thread Nuno Miguel Madeira Veiga
Hi, I am working on GLM models. However I am having some problems that I would like that someone give me some guidance One of the explanatory variables ERECTANGLE is not present in all the individual rows. 1 – when I delete the rows for which the variable ERECTANGLE is missing I get the

[R] logistic regression in an incomplete dataset

2010-04-05 Thread Desmond Campbell
Dear all, I want to do a logistic regression. So far I've only found out how to do that in R, in a dataset of complete cases. I'd like to do logistic regression via max likelihood, using all the study cases (complete and incomplete). Can you help? I'm using glm() with family=binomial(logit).

Re: [R] Creating R packages, passing by reference and oo R.

2010-04-05 Thread Duncan Murdoch
On 05/04/2010 7:35 AM, Roger Gill wrote: Dear All, I would like some advice on creating R packages, passing by reference and oo R. I have created a package that is neither elegant nor extensible and rather cumbersome (it works). I would like to re write the code to make the package

Re: [R] Co-occurrence

2010-04-05 Thread Joris Meys
R contains a whole set of functions to work with text strings, of which following are definitely worth a look : ?substr ?strsplit ?grep ?gsub ... Please provide us with an exact problem, and some sample R-code, e.g. I want to see if a certain word occurs in a vector : a - c(a,b,x,c) b

[R] logistic regression in an incomplete dataset

2010-04-05 Thread Desmond Campbell
Dear all, I want to do a logistic regression. So far I've only found out how to do that in R, in a dataset of complete cases. I'd like to do logistic regression via max likelihood, using all the study cases (complete and incomplete). Can you help? I'm using glm() with family=binomial(logit).

[R] ggplot2 geom_rect(): What am I missing here

2010-04-05 Thread Marshall Feldman
Thanks to David Winsemius, Peter Ehlers, and Paul Murrell who pointed out my careless error working with ggplot2's geom_rect(). Not to make excuses, but when you've done something successfully dozens of times and suddenly it doesn't work, you're more likely to look for careless errors on your

[R] A questionb about the Wilcoxon signed rank test

2010-04-05 Thread hix li
Hi guys,   I have two data sets of prices: endprice0, endprice1   I use the Wilcox test:   wilcox.test(endprice0, endprice1, paired = TRUE, alternative = two.sided,  conf.int = T, conf.level = 0.9)   The result is with V = 1819, p-value = 0.8812.   Then I calculated the z-value of the test:

Re: [R] Creating R packages, passing by reference and oo R.

2010-04-05 Thread Gabor Grothendieck
Passing by value does not necessarily mean physical copying. Check out this: x - matrix(1:1000^2, 1000, 1000) gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 114520 3.1 35 9.4 35 9.4 Vcells 577124 4.51901092 14.6 1577448 12.1 f - function(x) { y - max(x);

[R] bootstrap confidence intervals, non iid

2010-04-05 Thread Kay Cichini
hello, i need to calculate ci's for each of 4 groups within a dataset, to be able to infere about differences in the variable similarity. the problem is that data within groups is dependent, as assigned by the blocking-factor site. my guess was to use a block bootstrap but samples within in

[R] using difftime()

2010-04-05 Thread steve012
I'm new to R and have the following problem with difftime: if I directly assign date/time strings in difftime I get the expected result: a-2010-03-23 10:52:00 a [1] 2010-03-23 10:52:00 b-2010-03-23 11:53:00 u2-as.difftime(c(a,b), format =%Y-%m-%d %H:%M:%S, units=mins) u2 Time differences

Re: [R] GLM

2010-04-05 Thread David Winsemius
On Apr 5, 2010, at 5:32 AM, Nuno Miguel Madeira Veiga wrote: Hi, I am working on GLM models. However I am having some problems that I would like that someone give me some guidance One of the explanatory variables ERECTANGLE is not present in all the individual rows. 1 – when I delete

Re: [R] sample size 20K? Was: fitness of regression tree: how tomeasure???

2010-04-05 Thread Liaw, Andy
Just to follow up on Bert's and Frank's excellent comments. I'm continued to be amazed by people trying to interpret a single tree. Besides the variability in the tree structure (try bootstrapping and see how the trees change), it is difficult to make sense of splits more than a few levels down

Re: [R] using difftime()

2010-04-05 Thread jim holtman
First thing to notice in your second example is that you have factor for what you think are strings. You should try: u2-as.difftime(c(as.character(a),as.character(b)), format =%Y-%m-%d %H:%M:%S, units=mins) and see if this gives you what you are expecting. If you are reading this in with

Re: [R] A questionb about the Wilcoxon signed rank test

2010-04-05 Thread David Winsemius
On Apr 5, 2010, at 8:06 AM, hix li wrote: Hi guys, I have two data sets of prices: endprice0, endprice1 I use the Wilcox test: wilcox.test(endprice0, endprice1, paired = TRUE, alternative = two.sided, conf.int = T, conf.level = 0.9) The result is with V = 1819, p-value = 0.8812. Then

[R] R 2.6 Support Question

2010-04-05 Thread Raadt, Timothy W.
Hello, I have a question on the support of the R 2.6 software. We are in the process of planning for a hardware refresh and our new machines will be running Windows 7 and Internet Explorer 8. My question is if the R 2.6 software would be supported on a system running Windows 7 and

Re: [R] Creating R packages, passing by reference and oo R.

2010-04-05 Thread Sharpie
Gabor Grothendieck wrote: Passing by value does not necessarily mean physical copying. Check out this: x - matrix(1:1000^2, 1000, 1000) gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 114520 3.1 35 9.4 35 9.4 Vcells 577124 4.51901092 14.6 1577448

[R] skip for loop

2010-04-05 Thread Ravi S. Shankar
Hi R, I am running a for loop in which I am doing a certain calculation. As an outcome of calculation I get an out put say a. Now in my for loop I needs to be initiated to a. Based the below example if the output a=3 then the second iteration needs to be skipped. Is there a way to do

Re: [R] R 2.6 Support Question

2010-04-05 Thread Barry Rowlingson
On Mon, Apr 5, 2010 at 3:20 PM, Raadt, Timothy W. twra...@fedins.com wrote: Hello, I have a question on the support of the R 2.6 software.  We are in the process of planning for a  hardware refresh and our new machines will be running Windows 7 and Internet Explorer 8.   My question is if

[R] Rprintf not updating

2010-04-05 Thread Erik Wright
Hello all, I am using Rprintf in a C for loop (from .Call) to print a progress indicator showing the current percent complete. The loop I am doing is an time intensive call to another function. I have noticed that Rprintf does not print to the R-window until the entire loop has been

Re: [R] R 2.6 Support Question

2010-04-05 Thread Sharpie
Raadt, Timothy W. wrote: Hello, I have a question on the support of the R 2.6 software. We are in the process of planning for a hardware refresh and our new machines will be running Windows 7 and Internet Explorer 8. My question is if the R 2.6 software would be supported on a

Re: [R] R 2.6 Support Question

2010-04-05 Thread Marc Schwartz
On Apr 5, 2010, at 9:20 AM, Raadt, Timothy W. wrote: Hello, I have a question on the support of the R 2.6 software. We are in the process of planning for a hardware refresh and our new machines will be running Windows 7 and Internet Explorer 8. My question is if the R 2.6 software

Re: [R] logistic regression in an incomplete dataset

2010-04-05 Thread JoAnn Alvarez
Hello Desmond, The only way to not drop cases with incomplete data would be some sort of imputation for the missing covariates. JoAnn Desmond Campbell wrote: Dear all, I want to do a logistic regression. So far I've only found out how to do that in R, in a dataset of complete cases. I'd

Re: [R] skip for loop

2010-04-05 Thread Tal Galili
wouldn't using inside the loop: if (a==3){ # do one thing } else { # do another thing } Do the trick ? Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) |

[R] Deleting many list elements in one time

2010-04-05 Thread anna
Hi guys, here is a simple thing I want to do but it doesn't work: I have a vector of the element indexes that I want to delete called index so when I write myList[[index]] - NULL to delete these elements here is what I get: Error in myList[[index]] - NULL : more elements supplied than there

Re: [R] Deleting many list elements in one time

2010-04-05 Thread Duncan Murdoch
On 05/04/2010 11:17 AM, anna wrote: Hi guys, here is a simple thing I want to do but it doesn't work: I have a vector of the element indexes that I want to delete called index so when I write myList[[index]] - NULL to delete these elements here is what I get: Error in myList[[index]] - NULL :

Re: [R] Rprintf not updating

2010-04-05 Thread Sharpie
Erik Wright wrote: Hello all, I am using Rprintf in a C for loop (from .Call) to print a progress indicator showing the current percent complete. The loop I am doing is an time intensive call to another function. I have noticed that Rprintf does not print to the R-window until the

[R] Help transfrom R to C

2010-04-05 Thread pinusan
Dear R users, I would like to transform the following for loop from R-code to C-code because it takes really long time to have inc.freqy table. Unfortunately, I do not have experience to write C code. Plese, give me some example or advise to transfrom the R to C code. I have attached the code

[R] subtract a specified number of days from current date

2010-04-05 Thread Ravi S. Shankar
Hi R, I have a column with dates. I need to create a vector say from (current date-90 days: current date) For example I need to subtract 90 days from say Sys.Date()-92 If Sys.Date()-92 == Sunday, Sys.Date()-92+1 if Sys.Date()-92 == Saturday, Sys.Date()-92+2 i.e if subtracting

[R] find the next non-NA value within each row of a data-frame

2010-04-05 Thread Anna Stevenson
#I wish to find the next non-NA value within each row of a data-frame. #e.g. I have a data frame mydata. Rows 1, 2 3 have soem NA values. mydata - data.frame(matrix(seq(20*6), 20, 6)) mydata[1,3:5] -  NA mydata[2,2:3] -  NA mydata[2,5] -  NA mydata[3,6] -  NA mydata[1:3,] #this loop

Re: [R] Rprintf not updating

2010-04-05 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erik Wright Sent: Monday, April 05, 2010 7:59 AM To: r-help@r-project.org Subject: [R] Rprintf not updating Hello all, I am using Rprintf in a C for loop (from .Call) to

Re: [R] A questionb about the Wilcoxon signed rank test

2010-04-05 Thread Thomas Lumley
The problem is that your data contains ties, which mess up the nice theory and result in different people using different approximations. I don't know where your z-statistic formula comes from, but you can find the one R uses by looking at the source code in stats:::wilcox.test.default. To

Re: [R] Deleting many list elements in one time

2010-04-05 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan Murdoch Sent: Monday, April 05, 2010 8:24 AM To: anna Cc: r-help@r-project.org Subject: Re: [R] Deleting many list elements in one time On 05/04/2010 11:17 AM, anna

Re: [R] Help transfrom R to C

2010-04-05 Thread Thomas Lumley
On Mon, 5 Apr 2010, pinusan wrote: Dear R users, I would like to transform the following for loop from R-code to C-code because it takes really long time to have inc.freqy table. Unfortunately, I do not have experience to write C code. Plese, give me some example or advise to transfrom the R

Re: [R] A questionb about the Wilcoxon signed rank test

2010-04-05 Thread Peter Ehlers
Since this may be homework, I'll confine myself to a hint (which may or may not be the problem; I haven't checked): The formula you use for z is strongly dependent on the value of 'n'. -Peter Ehlers On 2010-04-05 6:06, hix li wrote: Hi guys, I have two data sets of prices: endprice0,

[R] Adding a prefix to all values in a col in a data.frame

2010-04-05 Thread Abhishek Pratap
Hi All I am looking for a way to prefix a constant value to all the rows in column in a data frame. Eg. V1 2 3 4 5 I want to make it like this V1 number2 number3 number4 number5 Thanks! -Abhi [[alternative HTML version deleted]] __

Re: [R] Adding a prefix to all values in a col in a data.frame

2010-04-05 Thread Henrique Dallazuanna
Try this: DF - transform(DF, V1 = sprintf('number%d', V1)) On Mon, Apr 5, 2010 at 2:38 PM, Abhishek Pratap abhishek@gmail.com wrote: Hi All I am looking for a way to prefix a constant value to all the rows in column in a data frame. Eg. V1 2 3 4 5 I want to make it like this

Re: [R] Adding a prefix to all values in a col in a data.frame

2010-04-05 Thread Abhishek Pratap
Thanks Henrique. It works fine. Cheers! -Abhi On Mon, Apr 5, 2010 at 1:41 PM, Henrique Dallazuanna www...@gmail.comwrote: Try this: DF - transform(DF, V1 = sprintf('number%d', V1)) On Mon, Apr 5, 2010 at 2:38 PM, Abhishek Pratap abhishek@gmail.com wrote: Hi All I am looking for

[R] NMDS Ordination Graphics Problem

2010-04-05 Thread Trey
Dr. Stevens, Hi, my name is Trey Scott, and I'm a grad student of Brian McCarthy's. He referred me to you because of your expertise in handling complex R problems. We were hoping you could help us solve a nagging problem that is prohibiting me from producing graphicl output. Here is a simple

[R] use of random and nested factors in lme

2010-04-05 Thread Joris Meys
Dear all, I've read numerous posts about the random and nested factors in lme, comparison to proc Mixed in SAS, and so on, but I'm still a bit confused by the notations. More specifically, say we have a model with a fixed effect F, a random effect R and another one N which is nested in R. Say

[R] Using pch with the RGL library

2010-04-05 Thread Iuri Gavronski
Hi, I am trying to compare two 3D plots. For that, I am trying to use the pch parameter in the points3d function, but it is not working. Is it implemented? Any suggestion? Here goes a reproducible code. I wanted the second plot having different symbols for the points. x -

Re: [R] NMDS Ordination Graphics Problem

2010-04-05 Thread stephen sefick
This is the easiest way I have found to do something similar to what you want. #output of dput() easy way to share data with the list x - (structure(list(a = c(1L, 12L, 2L, 0L, 0L, 13L), b = c(4L, 17L, 5L, 2L, 1L, 15L), c = c(7L, 6L, 8L, 4L, 4L, 19L), d = c(9L, 2L, 1L, 7L, 6L, 10L), e = c(2L, 3L,

[R] Pearson correlation matrix heatmap

2010-04-05 Thread Bill Hyman
Hi all, Does any one know how to make Pearson correlation matrix heatmap in R? The heatmap is a square with highly correlated elements clustered together. And the heatmap matrix is symmetric with respect to the diagonal line. Many thanks for your help! Bill

[R] Data manipulation problem

2010-04-05 Thread moleps
Dear R´ers. I´ve got a dataset with age and year of diagnosis. In order to age-standardize the incidence I need to transform the data into a matrix with age-groups (divided in 5 or 10 years) along one axis and year divided into 5 years along the other axis. Each cell should contain the number

Re: [R] Data manipulation problem

2010-04-05 Thread Erik Iverson
?cut to create categories ?table to make the table moleps wrote: Dear R´ers. I´ve got a dataset with age and year of diagnosis. In order to age-standardize the incidence I need to transform the data into a matrix with age-groups (divided in 5 or 10 years) along one axis and year divided into 5

Re: [R] Data manipulation problem

2010-04-05 Thread Bert Gunter
You have tempted, and being weak, I yield to temptation: Any good ideas? Yes. Don't do this. (what you probably really want to do is fit a model with age as a factor, which can be done statistically e.g. by logistic regression; or graphically using conditioning plots, e.g. via trellis graphics

[R] Matrix elements are vectors

2010-04-05 Thread Trafim Vanishek
Dear all, My question how is it possible to define a matrix A with 10 rows 1 column, so that its elements are vectors of undefined length. I need to have a possibility later to add elements like A[1,1] - c(A[1,1],3,4,5) Thanks a lot for the help! [[alternative HTML version deleted]]

Re: [R] Using pch with the RGL library

2010-04-05 Thread Duncan Murdoch
On 05/04/2010 2:27 PM, Iuri Gavronski wrote: Hi, I am trying to compare two 3D plots. For that, I am trying to use the pch parameter in the points3d function, but it is not working. Is it implemented? Any suggestion? Try reading the help page for points3d. There is no pch mentioned. You

Re: [R] Data manipulation problem

2010-04-05 Thread moleps
I already did try the regression modeling approach. However the epidemiologists (referee) turns out to be quite fond of comparing the incidence rates to different standard populations, hence the need for this labourius approach. And trying the cutting approach I ended up with : table (age5)

Re: [R] Matrix elements are vectors

2010-04-05 Thread Bert Gunter
Use lists: ?list (but probably assumes you know what a list is already) Relevant sections of An Introduction to R. (Considerable time and effort have been spent writing this to ease the entry of new users into R. Have you devoted any time or effort to reading it? ) Bert Gunter Genentech

Re: [R] Matrix elements are vectors

2010-04-05 Thread Daniel Malter
I may be mistaken, but I don't think that's possible or even should be possible. A matrix is m x n, where m and n are (kind of fixed) integers. You cannot have a matrix where m(1) to m(n) (the row lengths) vary. If you want to do this, you have to use a list instead (I believe). As a poor

Re: [R] Matrix elements are vectors

2010-04-05 Thread Duncan Murdoch
On 05/04/2010 3:20 PM, Trafim Vanishek wrote: Dear all, My question how is it possible to define a matrix A with 10 rows 1 column, so that its elements are vectors of undefined length. I need to have a possibility later to add elements like A[1,1] - c(A[1,1],3,4,5) Thanks a lot for the help!

Re: [R] Data manipulation problem

2010-04-05 Thread Erik Iverson
I don't know what your data are like, since you haven't given a reproducible example. I was imagining something like: ## generate fake data age - sample(20:90, 100, replace = TRUE) year - sample(1950:2000, 100, replace = TRUE) ##look at big table table(age, year) ## categorize data ## see

Re: [R] skip for loop

2010-04-05 Thread Etienne Bellemare Racine
you can use break : for(i in 1:5) { #e.g. a - sample(1:10, 1) # important part : if(a==3) break } a or while : a - 0 while(a != 3){ # an operation that change a : a - sample(1:10, 1) } Etienne Le 2010-04-05 10:46, Ravi S. Shankar a écrit : Hi R, I am running a for

Re: [R] Data manipulation problem

2010-04-05 Thread moleps
Thx Erik, I have no idea what went wrong with the other code snippet, but this one works.. Appreciate it. qta- table(cut(age,breaks = seq(0, 100, by = 10),include.lowest = TRUE),cut(year,breaks=seq(1950,2010,by=5),include.lowest=TRUE)) M On 5. apr. 2010, at 21.45, Erik Iverson wrote: I

[R] SAS and R on multiple operating systems

2010-04-05 Thread Roger DeAngelis(xlr82sas)
Hi, This is not meant to be critical of R, but is intended as a possible source for improvements to R. SAS needs the competition. I am reasonably knowledgeable about R SAS-(all products including IML) SAS and R run on Windows(all flavors) UNIX(all flavors) Apple OSs Does R run on natively

Re: [R] Rprintf not updating

2010-04-05 Thread Erik Wright
Hi Charlie, I like your idea of updating an R progress bar from C, but I don't at all understand how to call txtProgressBar from C. I have looked at Writing R Extensions and it is equally confusing. Any help would be appreciated. Thanks!, Erik On Apr 5, 2010, at 10:29 AM, Sharpie wrote:

Re: [R] logistic regression in an incomplete dataset

2010-04-05 Thread Emmanuel Charpentier
Dear Desmond, a somewhat analogous question has been posed recently (about 2 weeks ago) on the sig-mixed-model list, and I tried (in two posts) to give some elements of information (and some bibliographic pointers). To summarize tersely : - a model of information missingness (i. e. *why* are

[R] changing column names in a dataframe

2010-04-05 Thread jda
Hi folks, I have imported data from an Excel spreadsheet. Columns in that spreadsheet are named name, x, and y, and several sets of those columns appear in the worksheet. For example: name x y name x y test1 1 3 test2 4 4 test1 2 2 test2 5 5 test1 3 1 test2 6 6 When I import these data

Re: [R] find the next non-NA value within each row of a data-frame

2010-04-05 Thread Peter Ehlers
If I understand correctly what you want (according to your loop), you could use the na.locf function in pkg:zoo. library(zoo) mat - t(apply(mydata, 1, na.locf, fromLast=TRUE, na.rm=FALSE)) dat - as.data.frame(mat) ## since apply returns a matrix -Peter Ehlers On 2010-04-05 10:52, Anna

[R] a warning message from heatmap.2

2010-04-05 Thread Tao Shi
Hi List, I want to show the heatmap of a correlation matrix using heatmap.2, however always get this warning message (see below) and the column dendrogram is not showing.  It's not really a big deal, but curious how to suppress it and still let R show what I want to show (i.e. a symmetrical

[R] contradictory output between ncv.test() and gvlma()

2010-04-05 Thread Anthony Lopez
Can anyone tell me why the ncv.test output and the gvlma output would be contradictory on the question of heteroscedasticity? Below, the ncv.test output reveals a problem with heteroscedasticity, but the gvlma output says that the assumptions are acceptable. How is this reconciled?

Re: [R] find the next non-NA value within each row of a data-frame

2010-04-05 Thread Gabor Grothendieck
Here is a slight simplification to the first line based on the fact that na.locf works column by column: mat - t(na.locf(t(mydata), fromLast = TRUE, na.rm = FALSE)) On Mon, Apr 5, 2010 at 1:46 PM, Peter Ehlers ehl...@ucalgary.ca wrote: If I understand correctly what you want (according to your

[R] new to R, analysis of latency data

2010-04-05 Thread jeff d
Hi, I'd like to move from excel to R because our dataset are so large. Here's what my data looks like: Transaction Rate Run# Transaction TypeLocationLatency in Seconds 101 Order A

[R] Permutation of Matrix

2010-04-05 Thread Ayush Raman
Hi all, How can I have a permuted matrix where the second row is the permutation over the first row ; third is the permutation of the second row; forth is the permutation of the third row and so on ? Thanks. -- Regards, Ayush Raman [[alternative HTML version deleted]]

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Thomas Lumley
On Mon, 5 Apr 2010, Roger DeAngelis(xlr82sas) wrote: SAS and R run on Windows(all flavors) UNIX(all flavors) Apple OSs I would expect that for more obscure Unices it would be difficult to get SAS, but basically, yes. Does R run on natively (no emulation)? We have quite a few users on

Re: [R] Rprintf not updating

2010-04-05 Thread Sharpie
Erik Wright wrote: Hi Charlie, I like your idea of updating an R progress bar from C, but I don't at all understand how to call txtProgressBar from C. I have looked at Writing R Extensions and it is equally confusing. Any help would be appreciated. Thanks!, Erik Hi Erik, Did

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Kevin Middleton
SAS and R run on Windows(all flavors) UNIX(all flavors) Apple OSs According to SAS (http://support.sas.com/kb/33/140.html and http://support.sas.com/kb/22/960.html), SAS will not run on OS X past 10.4. OS X 10.5 was released in late 2007, so I don't think it's really fair to say that SAS

Re: [R] changing column names in a dataframe

2010-04-05 Thread Ista Zahn
If the columns are in order you can just past in the new names: Dat - read.table(textConnection(name x y name1 x1 y1 test1 1 3 test2 4 4 test1 2 2 test2 5 5 test1 3 1 test2 6 6), header=TRUE) closeAllConnections() x.vars - grep(x, names(Dat)) y.vars - grep(y, names(Dat)) names.vars -

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Roger DeAngelis(xlr82sas)
Hi, You are correct SAS no longer supports OS X under SAS-Proper. I use the term SAS-Proper for base SAS with SAS-Connect. It does appear that some improper SAS products are supported under MAC OS? SAS releases JMP® 8 for Mac, Linux Users of all major desktop operating systems can now

Re: [R] logistic regression in an incomplete dataset

2010-04-05 Thread Desmond D Campbell
Dear JoAnn, Thank you very much for your reply. If that is the case I am surprised. I would have though ML could incorporate study cases with some missingness in them. Furthermore I believe ML estimates should generally be more robust than complete case based estimates. For unbiased estimates I

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Barry Rowlingson
On Mon, Apr 5, 2010 at 9:13 PM, Roger DeAngelis(xlr82sas) rdean...@amgen.com wrote: Hi, This is not meant to be critical of R, but is intended as a possible source for improvements to R. SAS needs the competition. I am reasonably knowledgeable about R SAS-(all products including IML)

Re: [R] logistic regression in an incomplete dataset

2010-04-05 Thread Desmond D Campbell
Dear Emmanuel, Thank you. Yes I broadly agree with what you say. I think ML is a better strategy than complete case, because I think its estimates will be more robust than complete case. For unbiased estimates I think ML requires the data is MAR, complete case requires the data is MCAR

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Stuart Luppescu
On Mon, 2010-04-05 at 23:12 +0100, Barry Rowlingson wrote: 3. Highlight and hit F3 and the code is run interactively in unix. Okay, what's going on here? You have a Windows box (presumably in front of you) and a Unix box somewhere on the network. And hitting F1 runs it on the Windows

Re: [R] Permutation of Matrix

2010-04-05 Thread David Winsemius
On Apr 5, 2010, at 4:58 PM, Ayush Raman wrote: Hi all, How can I have a permuted matrix where the second row is the permutation over the first row ; third is the permutation of the second row; forth is the permutation of the third row and so on ? Wouldn't any of those permutations just

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Roger DeAngelis(xlr82sas)
Hi, I am using SSH, however I do have to set up a SAS Spawner on the remote host and use SAS remote library services. I also have to have listeners on both client and host? I am not a systems guy, so I do not know exactly how SAS makes the remote libraries available to windows. It is a

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Roger DeAngelis(xlr82sas)
Hi, Here is the SAS command macro that reads what I highlight in my editor and prints 40 observations from the highlighted dataset after hitting the function key F4 F4 stores the highlighted text in the clipboard then executes the command macro, the rsubmit executes the code on the unix zeus

Re: [R] new to R, analysis of latency data

2010-04-05 Thread Dennis Murphy
Hi: I'll use some fake data to show you how to get the plots. To get the data from Excel into R, there are several ways to do it: converting the Excel file into csv and using read.csv() in R is one method and the XLSReadWrite package is another. Here's a link from the R Wiki:

Re: [R] Permutation of Matrix

2010-04-05 Thread Marc Schwartz
On Apr 5, 2010, at 5:25 PM, David Winsemius wrote: On Apr 5, 2010, at 4:58 PM, Ayush Raman wrote: Hi all, How can I have a permuted matrix where the second row is the permutation over the first row ; third is the permutation of the second row; forth is the permutation of the third row

[R] predict.lm

2010-04-05 Thread Luis Felipe Parra
Hello I am trying to use predict.lm, but I am having trouble getting out of sample predictions. I am getting the same output if I use the following three commands: predict(ModeloLineal,predictors[721:768,]) predict(ModeloLineal,predictors[1:768,]) predict(ModeloLineal) where ModeloLineal is the

[R] Agnes in Cluster Package and index.G1 in the clusterSim package questions

2010-04-05 Thread Pancho Aguirre
Dear R Users: I am new to R and I am trying to do a cluster analysis on a single continuous variable using the Agnes [Agglomerative Nesting (Hierarchical Clustering) ] in the Package ‘cluster’. I was able to apply this clustering method to my data: ward1 - Agnes(balances, diss= FALSE,

Re: [R] Rprintf not updating

2010-04-05 Thread Erik Wright
Hi Charlie, Thanks, I got it working by looking at your myRunIfConcise function. SEXP changePercent(SEXP pBar) { int *rPercentComplete; SEXP utilsPackage, percentComplete; PROTECT(utilsPackage = eval(lang2(install(getNamespace), ScalarString(mkChar(utils))),

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Roger DeAngelis(xlr82sas)
Hi, One other point. The connection I have with mutiple servers is persistent the windows SAS executable is is constant contact with all the SAS server executables. Also I can submit a job where unix code is interspersed with windows code. I do execute R and perl from SAS using pipes.

Re: [R] logistic regression in an incomplete dataset

2010-04-05 Thread Thomas Lumley
On Mon, 5 Apr 2010, Desmond D Campbell wrote: Dear Emmanuel, Thank you. Yes I broadly agree with what you say. I think ML is a better strategy than complete case, because I think its estimates will be more robust than complete case. For unbiased estimates I think ML requires the data is MAR,

[R] strange behavior of matrix

2010-04-05 Thread William Revelle
Dear R list, I have discovered a seemingly peculiar feature when using a matrix to index itself (yes, this is strange code, which I have now modified to be more reasonable). #this makes sense s - matrix(1:3,nrow=1) s[s]#all three elements are shown #but when I try s -

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Roger DeAngelis(xlr82sas)
Hi, One final point about persistent simultaneous environments. In windows I sit in my development directory(PWD) and simultaneously my Unix session sits in my production directory(PWD). This simplifies versioning, promotion to production and batch execution. My Unix session is

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Roger DeAngelis(xlr82sas) Sent: Monday, April 05, 2010 3:35 PM To: r-help@r-project.org Subject: Re: [R] SAS and R on multiple operating systems Hi, I am using SSH,

Re: [R] strange behavior of matrix

2010-04-05 Thread Phil Spector
William - An interesting feature of matrix indexing in R is that if you provide a two column matrix as a subscript, you are refering to the elements whose indices are in the rows of the matrix. This is extremely handy for converting tables to matrices: m =

Re: [R] Rprintf not updating

2010-04-05 Thread Sharpie
Erik Wright wrote: Hi Charlie, Thanks, I got it working by looking at your myRunIfConcise function. SEXP changePercent(SEXP pBar) { int *rPercentComplete; SEXP utilsPackage, percentComplete; PROTECT(utilsPackage = eval(lang2(install(getNamespace),

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Roger DeAngelis(xlr82sas)
Hi, You are absolutely correct about 32/64 and it appears to be a severe penalty. But I think 32 to 32(win/unix) does not incur the penalty. There are even more issues between mainframe and unix/windows. The 32 to 64 is a big hit when querying data dictionaries that have a mixture of 32/64 bit

Re: [R] use of random and nested factors in lme

2010-04-05 Thread Kingsford Jones
On Mon, Apr 5, 2010 at 12:21 PM, Joris Meys jorism...@gmail.com wrote: Dear all, I've read numerous posts about the random and nested factors in lme, comparison to proc Mixed in SAS, and so on, but I'm still a bit confused by the notations. More specifically, say we have a model with a fixed

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Gabor Grothendieck
On Mon, Apr 5, 2010 at 8:34 PM, Roger DeAngelis(xlr82sas) rdean...@amgen.com wrote: Hi,  You are absolutely correct about 32/64 and it appears to be a severe penalty. But I think 32 to 32(win/unix) does not incur the penalty. There are even more issues between mainframe and unix/windows. The

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Douglas Bates
On Mon, Apr 5, 2010 at 3:13 PM, Roger DeAngelis(xlr82sas) rdean...@amgen.com wrote: Hi, This is not meant to be critical of R, but is intended as a possible source for improvements to R. SAS needs the competition. I am reasonably knowledgeable about R SAS-(all products including IML)

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Roger DeAngelis(xlr82sas)
Hi, Again I slight mistake on my part. One of the largest Pharmaceutical Contract companies uses VMS. I erroneously added the VAX in front from my memory. I don't want to mention the company, but if anyone else there is familiar with contact pharma companies, one of these uses

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Roger DeAngelis(xlr82sas)
Hi, About the forest plot. Some Phrarma companies demand the report and graphics follow very restrictive layouts. SAS allows uses to use one template for graphs and tables. Margins have to the same for all reports. Fonts, fontsizes, linewidths, boxing body, cell spacing, cell

[R] Error with read.csv.sql on processing large file

2010-04-05 Thread Moiz Saifee
Hi, I was trying to read filter records from a large file using read.csv.sql. I was successfully able to do that with a ~1 GB file. However I get the following error with a 2 GB file which has exactly the same structure as the first file. *Error in try({ : * * RS-DBI driver: (RS_sqlite_import: