Re: [R] how to replace my double for loop which is little efficient!

2010-12-27 Thread Berend Hasselman
bbslover wrote: thanks for your help. I am sorry I do not full understand your code, so i can not correct using your code to my data. here is the attachment of my data, and what I want to compute is the equation in the word document of the attachment: the code form Berend can get the

Re: [R] Question about mars() -function

2010-12-27 Thread peter dalgaard
On Dec 26, 2010, at 17:54 , Tiina Hakanen wrote: Hi! I have some questions about MARS model's coefficient of determination. I use the MARS method in my master's thesis and I have noticed some problems with the MARS model's R^2. You can see the following example that the MARS model's

Re: [R] how to replace my double for loop which is little efficient!

2010-12-27 Thread Berend Hasselman
Found this: http://en.wikipedia.org/wiki/Jaccard_index#Tanimoto_coefficient_.28extended_Jaccard_coefficient.29 and an R site search with tanimoto yielded some more interesting stuff. The rest is up to you. Berend -- View this message in context:

Re: [R] filled.contour colors

2010-12-27 Thread Jim Lemon
On 12/27/2010 02:21 PM, randhindi wrote: Hi, I am trying to set the color scale in filled.contour based on a specific value instead of a relative position. Specifically, I want the values below 0 to be in a gradient of green, and those above 0 to be red. 0 would be white. I tried: posZero =

Re: [R] Doing a mixed-ANOVA after accounting for a covariate

2010-12-27 Thread Dror D Lev
Thank you David and Rich for your reply. I will try to get more concrete with an artificial example that replicates the structure of the data sets I'm analyzing. It will include analysis suggestions based on what I was able to figure out from the demo(MMC.apple). At the end there is my current

Re: [R] modifying user agent strings in http requests

2010-12-27 Thread Mike Marchywka
From: soumen...@gmail.com Date: Mon, 27 Dec 2010 11:17:49 +0530 To: r-h...@stat.math.ethz.ch Subject: [R] modifying user agent strings in http requests Hi all. How does one change user agent strings in http requests made in R? And how do I figure out what my current user agent string

Re: [R] Parsing a Simple Chemical Formula

2010-12-27 Thread Mike Marchywka
Date: Sun, 26 Dec 2010 20:24:23 -0800 From: spencer.gra...@structuremonitoring.com To: han...@depauw.edu CC: r-h...@stat.math.ethz.ch Subject: Re: [R] Parsing a Simple Chemical Formula Mike Marchywka's post mentioned a CRAN package, rpubchem,

Re: [R] how to replace my double for loop which is little efficient!

2010-12-27 Thread bbslover
Thank Berend, It seems like that it is better to attach a PDF file for avoiding messy code. Yes, I want to obtain is Tanimoto coefficient and your web site wikipedia is about this coefficient. I also search R site about tanimoto coefficient and learn it more. About your code, I has saved and

[R] Heteroskedasticity and autocorrelation of residuals

2010-12-27 Thread araiss
Hello everyone, I'm working on a current linear model Y = a0 + a1* X1 + ... + a7*X7 + residuals. And I know that this model presents both heteroskedasticity (tried Breusch-Pagan test and White test) and residuals autocorrelation (using Durbin Watson test). Ultimately, this model being meant to be

Re: [R] Parsing a Simple Chemical Formula

2010-12-27 Thread Mike Marchywka
From: han...@depauw.edu To: dwinsem...@comcast.net Date: Sun, 26 Dec 2010 22:36:49 -0500 CC: r-h...@stat.math.ethz.ch Subject: Re: [R] Parsing a Simple Chemical Formula Hi David others... I did find the function you recommended, plus, it's even easier (but a little hidden in the

Re: [R] filled.contour colors

2010-12-27 Thread randhindi
Great, I will have a look at it! Thanks! On Mon, Dec 27, 2010 at 12:52 PM, Jim Lemon [via R] ml-node+3164904-680716452-206...@n4.nabble.com wrote: On 12/27/2010 02:21 PM, randhindi wrote: Hi, I am trying to set the color scale in filled.contour based on a specific value instead of a

Re: [R] levelplot blocks size

2010-12-27 Thread Greg Snow
Look at the functions cut, findInterval, tapply, and aggregate. Sent from my iPod On Dec 26, 2010, at 4:34 PM, jonathan j...@than.biz wrote: Thanks for your advice, but my data is not decimals, so I don't need to round the values. Instead, what I need to really do is group the values into

Re: [R] Drop column from a data frame

2010-12-27 Thread David Winsemius
On Dec 26, 2010, at 8:22 PM, John Sorkin wrote: I am trying to drop a column of a data frame. The code below attempts to drop a numeric column (which does not work but gives no error or warning) and a factor column (which does not work but gives an error). I would appreciate someone

Re: [R] Nagelkerke R square for Prediction data

2010-12-27 Thread Soeren . Vogel
Hello I found some small postings dated to 22 Oct 2008 on the message subject. Recently, I have been working with binary logistic regressions. I didn't use the design package. Yet, I needed the fit indices. Therefore, I wrote a small function to output the Nagelkerke's R, and the Cox--Snell R

[R] Can't merge on datetime?

2010-12-27 Thread Dimitri Shvorob
x = structure(list(date = structure(list(sec = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), min = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), hour = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,

[R] [R-pkgs] mcga 1.1 (machine coded genetic algorithms) package released

2010-12-27 Thread Mehmet Hakan Satman
mcga 1.1 (machine coded genetic algorithms) package implements a genetic algorithm optimisation tool with machine coded chromosomes. The machine coded chromosomes stand for chromosomes that are not decoded and encoded. The byte representation of 'double' type variables are crossed-over and

Re: [R] Can't merge on datetime?

2010-12-27 Thread Henrique Dallazuanna
Convert to POSIXct: x$date - as.POSIXct(x$date, tz = GMT) y$date - as.POSIXct(y$date, tz = GMT) merge(x, y, all = TRUE) On Mon, Dec 27, 2010 at 2:14 PM, Dimitri Shvorob dimitri.shvo...@gmail.comwrote: x = structure(list(date = structure(list(sec = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

[R] [R-pkgs] First release of package cg for comparison of groups

2010-12-27 Thread Bill Pikounis
Version 0.9.0, a first release of cg, is published on CRAN and its mirrors. The cg name stands for compare groups. Its genesis and evolution are driven by common in-practice needs to compare samples, treatments, administrations, conditions, etc. in medicine research development. The current

Re: [R] read.data? without separator

2010-12-27 Thread Greg Snow
Would the read.fwf function work for you? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Fror Sent: Sunday,

Re: [R] Where to find rcompgen package?

2010-12-27 Thread Uwe Ligges
On 25.12.2010 15:44, David Winsemius wrote: On Dec 25, 2010, at 8:08 AM, Megh Dal wrote: Dear all, can somebody point me from where to download rcompgen package? CRAN does not seem to hold that. http://lmgtfy.com/?q=rcompgen Or more specific (since the first Google hits do not tell

[R] matrix looping accessing previous column

2010-12-27 Thread R_novice
Hi, I have a matrix with numbers and character. I want to evaluate each cell and change the value of the cell before it depending on the evaluation. My evaluation: if a cell had the word down change the cell preceding it to a negative number by multiplying that value by a -1. I am have trouble

Re: [R] matrix looping accessing previous column

2010-12-27 Thread Henrique Dallazuanna
Try this: x V1 V2 V3 V4 1 PROBE 1 2.5 UP 2 PROBE 2 1.0 UP 3 PROBE 3 1.4 DOWN 4 PROBE 4 2.0 UP 5 PROBE 5 1.3 DOWN x$V3[which(x$V4 == DOWN) - 1] - x$V3[which(x$V4 == DOWN) - 1] * -1 On Mon, Dec 27, 2010 at 4:11 PM, R_novice kaso...@battelle.org wrote: Hi, I have a matrix

Re: [R] Help on lme output. what are the estimates in $modelStruct

2010-12-27 Thread Dieter Menne
Lei wrote: I have been playing with lme fitting different kinds of model. I am puzzled by the estimates associated with $modelStruct and I have no idea what they are? e.g if I fit a random intercept model using the following fit.0-lme(y~time,random=list(subject=pdIdent(~1))) The

Re: [R] Calculation of BIC done by leaps-package

2010-12-27 Thread Peter Ehlers
On 2010-12-26 06:47, Jan Henckens wrote: Hi Folks, I've got a question concerning the calculation of the Schwarz-Criterion (BIC) done by summary.regsubsets() of the leaps-package: Using regsubsets() to perform subset-selection I receive an regsubsets object that can be summarized by

Re: [R] need help with data management

2010-12-27 Thread analys...@hotmail.com
On Dec 25, 1:36 pm, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Sat, Dec 25, 2010 at 8:08 AM, analys...@hotmail.com analys...@hotmail.com wrote: I have a data frame that reads client ID date transcations 323232   11/1/2010 22 323232   11/2/2010 0 323232   11/3/2010

Re: [R] matrix looping accessing previous column

2010-12-27 Thread R_novice
Thank you for the quick response :-). I've applied your suggestion to my code, but I still receive an error: CEM1_PARTIAL$V3[which(CEM1_PARTIAL$V4 == DOWN) - 1] - CEM1_PARTIAL$V3[which(CEM1_PARTIAL$V4 == DOWN) - 1] * -1 Warning message: In Ops.factor(CEM1_PARTIAL$V3[which(CEM1_PARTIAL$V4 ==

Re: [R] matrix looping accessing previous column

2010-12-27 Thread Henrique Dallazuanna
Convert your column to numeric: CEM1_PARTIAL$V3 - as.numeric(as.character(CEM1_PARTIAL$V3)) On Mon, Dec 27, 2010 at 4:28 PM, R_novice kaso...@battelle.org wrote: Thank you for the quick response :-). I've applied your suggestion to my code, but I still receive an error:

Re: [R] matrix looping accessing previous column

2010-12-27 Thread R_novice
That just converts my values in V3 to NA -- View this message in context: http://r.789695.n4.nabble.com/matrix-looping-accessing-previous-column-tp3165308p3165340.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] can't install R with *local* gcc

2010-12-27 Thread Oliver Kullmann
Hello, I infer from your answer that piece of information which is most important for us now: That my configuration instructions for R should work (should be correct). Given all these unspecified build-systems we have to fight (at least Gmp, Mpfr, Gcc with everything in it, R, and finally our

[R] Problem using pkg survival

2010-12-27 Thread James Steinberg
Hello all. I've been attempting to utilize the survival pkg ( http://cran.r-project.org/web/packages/survival/index.html), while reading through this guide (http://www.ms.uky.edu/~mai/Rsurv.pdf). I figured working through the guide would be the best way to go, before attempting my own data. I

Re: [R] matrix looping accessing previous column

2010-12-27 Thread R_novice
Using which() improves my code, but now I'm receiving some data.frame error and still does not convert the values to negative. #TAKE PART OF MATRIX CEM1_PARTIAL - CEM1[1:10,1:10] #CEM1_PARTIAL=apply(CEM1_PARTIAL,2,as.character) #CEM1_PARTIAL - as.numeric(as.character(CEM1_PARTIAL))

Re: [R] Problem using pkg survival

2010-12-27 Thread peter dalgaard
On Dec 27, 2010, at 19:48 , James Steinberg wrote: Hello all. I've been attempting to utilize the survival pkg ( http://cran.r-project.org/web/packages/survival/index.html), while reading through this guide (http://www.ms.uky.edu/~mai/Rsurv.pdf). I figured working through the guide would

[R] Any functions to manipulate (merge, cut, remove) hclust objects? (maybe through phylo?)

2010-12-27 Thread Tal Galili
Hello all, I'm now working with hclust objects and was hoping to perform some basic editing on them like: - Joining = the merging of two hclust objects (so they will share one root) - Splicing = So to cut/extract a branch out of an hclust object - that by itself will be an hclust

[R] R-code to generate random rotation matrix for rotation testing

2010-12-27 Thread Martin Krautschke
Dear list, I am looking for an implementation of random rotation matrix generation in R to do a rotation test: I want to use the matrices to create random multivariate normal matrices with common covariance structure and mean based on an observed data matrix. The rRotationMatrix-function in

[R] Gamma Lognormal Model

2010-12-27 Thread Louisa
Dear, I'm very new to R Gui and I have to make an assignment on Gamma Regressions. Surfing on the web doesn't help me very much so i hope this forum may be a step forward. The question sounds as follows: The data set is in the library MASS first install library(MASS) then type data(mammals)

Re: [R] Gamma Lognormal Model

2010-12-27 Thread Duncan Murdoch
On 10-12-27 3:08 PM, Louisa wrote: Dear, I'm very new to R Gui and I have to make an assignment on Gamma Regressions. Surfing on the web doesn't help me very much so i hope this forum may be a step forward. This forum isn't for homework. You should ask your instructor for help. Duncan

[R] Finding indexes of minum and maximum elements of an array

2010-12-27 Thread Eduardo de Oliveira Horta
Hello there I wish to get the coordinates of the minimum element of an array. For example, if the array were H = array(c(8:5,1:4),dim=c(2,2,2)) H , , 1 [,1] [,2] [1,]86 [2,]75 , , 2 [,1] [,2] [1,]13 [2,]24 then min(H) [1] 1 and max(H) [1] 8

[R] Fitting mixed effects Baseline category logit models

2010-12-27 Thread DHIMAN BHADRA
Hello everyone, I want to fit a baseline category logit model (with 3-4 categories) with nested random effects. (For example, I have clusters(i) and households within clusters (j) resulting in the nested random effects structure : b_i +d_j(i)). Is there a R function/package that I can use ? Any

Re: [R] Finding indexes of minum and maximum elements of an array

2010-12-27 Thread Duncan Murdoch
On 10-12-27 5:26 PM, Eduardo de Oliveira Horta wrote: Hello there I wish to get the coordinates of the minimum element of an array. For example, if the array were H = array(c(8:5,1:4),dim=c(2,2,2)) H , , 1 [,1] [,2] [1,]86 [2,]75 , , 2 [,1] [,2] [1,]13

Re: [R] Fitting mixed effects Baseline category logit models

2010-12-27 Thread Dennis Murphy
Hi: Try the mlogit() function in package mlogit. It appears to handle random effects terms, but I don't know offhand if that includes hierarchical random effects. You can always try it out... HTH, Dennis On Mon, Dec 27, 2010 at 2:43 PM, DHIMAN BHADRA dhimanbha...@gmail.comwrote: Hello

[R] linear regression with dates

2010-12-27 Thread Entropi ntrp
Hi, I am trying to do simple linear regression using dates in R but receiving error messages. With the data shown below, I would like to regress x on y. x y 11/12/1999 56.8 11/29/1999 17.9 01/04/2000 27.4 1/14/2000 96.8 1/31/2000 49.5 R gives the following

Re: [R] linear regression with dates

2010-12-27 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Entropi ntrp Sent: Monday, December 27, 2010 3:05 PM To: r-help@r-project.org Subject: [R] linear regression with dates Hi, I am trying to do simple linear regression using

[R] another superscript problem

2010-12-27 Thread T.D. Rudolph
I've exceeded the maximum time I am willing to accept for solving simple problems so I thank all in advance for your assistance. I am trying to plot text combined with an object value and a superscript. obv = 5 text = Population mean = ss = ^o # degrees Something like this (very naive so you

Re: [R] Finding indexes of minum and maximum elements of an array

2010-12-27 Thread Phil Spector
Here's one way: H = array(c(8:5,1:4),dim=c(2,2,2)) which(H==min(H),arr.ind=TRUE) dim1 dim2 dim3 [1,]112 which(H==max(H),arr.ind=TRUE) dim1 dim2 dim3 [1,]111 - Phil Spector

[R] Reading sas7bdat files into R

2010-12-27 Thread Sashi Challa
Hi All, I am trying to import a .sas7bdat file into R. I tried using Hmisc package's sasxport.get() function. temp - sasxport.get(path\abcd.sas7bdat) I get an error that says Error in lookup.xport(file) : file not in SAS transfer format I am not familiar with SAS transfer format. Could

Re: [R] another superscript problem

2010-12-27 Thread David Winsemius
On Dec 27, 2010, at 6:40 PM, T.D. Rudolph wrote: I've exceeded the maximum time I am willing to accept for solving simple problems so I thank all in advance for your assistance. I am trying to plot text combined with an object value and a superscript. obv = 5 text = Population mean =

Re: [R] Reading sas7bdat files into R

2010-12-27 Thread John Sorkin
I can't say for sure as I have never used sasxport.get, but I believe that a SAS export file is not the same as a sas library. I believe you are trying to read a SAS library file with an R program that may have been written to read a SAS export file. John John Sorkin Chief Biostatistics and

Re: [R] Reading sas7bdat files into R

2010-12-27 Thread Sashi Challa
Thanks for your reply John. I guess you are correct, sasxport.get function is for files in SAS transfer format. Do you know how I can convert the .sas7bdat file into SAS export file that I suppose will be in SAS transfer format? Thanks Sashi -Original Message- From: John Sorkin

Re: [R] Reading sas7bdat files into R

2010-12-27 Thread John Sorkin
Try sas.get to read the library. You will need the Hmisc package. Let me know if you have success. John John Sorkin Chief Biostatistics and Informatics Univ. of Maryland School of Medicine Division of Gerontology and Geriatric Medicine jsor...@grecc.umaryland.edu -Original Message- From:

Re: [R] another superscript problem

2010-12-27 Thread Peter Ehlers
On 2010-12-27 16:51, David Winsemius wrote: On Dec 27, 2010, at 6:40 PM, T.D. Rudolph wrote: I've exceeded the maximum time I am willing to accept for solving simple problems so I thank all in advance for your assistance. I am trying to plot text combined with an object value and a

Re: [R] Reading sas7bdat files into R

2010-12-27 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of John Sorkin Sent: Monday, December 27, 2010 5:18 PM To: cha...@ohsu.edu; r-help@r-project.org Subject: Re: [R] Reading sas7bdat files into R Try sas.get to read the library.

Re: [R] linear regression with dates

2010-12-27 Thread Entropi ntrp
Thanks for the response. I proivded the necessary details below, and also have a general question for how to deal with dates in R. Is there a way to make R read dates as numbers? Here is the details of the R code: egfr - read.csv(file.choose(), header=TRUE, sep=,) #egfr is a matrix read from

Re: [R] levelplot blocks size

2010-12-27 Thread jonathan
Thanks for your help. Might you be able to explain in a little more detail how to use those functions to solve this specific problem? I'm happy to put in the work myself and have looked up those functions but am new to R and still a little unsure about how I would go about using those functions

Re: [R] linear regression with dates

2010-12-27 Thread David Winsemius
On Dec 27, 2010, at 8:56 PM, Entropi ntrp wrote: Thanks for the response. I proivded the necessary details below, and also have a general question for how to deal with dates in R. Is there a way to make R read dates as numbers? Here is the details of the R code: egfr -

Re: [R] Reading sas7bdat files into R

2010-12-27 Thread Frank Harrell
You might post to r-help (see www.r-project.org for how to get to the R mailing lists). There are perhaps 3 programs that will read sas7bdat files. One is the SAS dataset reader (I forgot its actual name) which produces csv files (watch out for bugs such as unmatched quote marks in character

[R] Importing Sas files to R

2010-12-27 Thread Rekha
Dear All, Am trying to import SAS files to R. For that i used library Hmisc and try-sas.get(C:\\ex.sas7bdat) . But it shows error that Error in sas.get(C:\\ex.sas7bdat) : SAS member name is required In addition: Warning message: In sas.get(C:\\ex.sas7bdat) : C:\ex.sas7bdat/formats.sc? or

Re: [R] Importing Sas files to R

2010-12-27 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Rekha Sent: Monday, December 27, 2010 8:33 PM To: r-help@r-project.org Subject: [R] Importing Sas files to R Dear All, Am trying to import SAS files to R. For that i used