Re: [R] truncated normal

2008-07-23 Thread Berwin A Turlach
G'day all, On Wed, 23 Jul 2008 20:48:59 -0400 Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 23/07/2008 8:17 PM, cindy Guo wrote: > > Yes, I know. I mean if I want to generate 100 numbers from > > N(0,1)I((0,1),(5,10)). There are two intervals (0,1) and (5,10). > > Then the function will give 50

[R] convert a vector of words into a matrix

2008-07-23 Thread Daren Tan
How to convert the strings into matrix ? (strings <- strsplit(c("1 2 3", "1 2", "1 3 4 5"), " "))[[1]][1] "1" "2" "3" [[2]][1] "1" "2" [[3]][1] "1" "3" "4" "5" _ Easily edit your photos like a pro with Photo Gallery. [[al

[R] how to export ".xls" file with colorful cells?

2008-07-23 Thread XinMeng
Hi all: I wanna know how to expoort ".xls" file. And in the exported ".xls" file, how to set different cells with different color? Thanks a lot! My best. -- *** Xin Meng Capitalbio Corporation National Engineering Research

Re: [R] Histogram

2008-07-23 Thread Vincent Goulet
Le mer. 23 juil. à 14:29, Angelo Scozzarella a écrit : Hi, how can I treat data organised in classes and frequencies? Ex. class frequency 20-23 9 23-25 7 26-28 5 29-31 5 32-34 3 It depends w

Re: [R] Can R fill in missing values?

2008-07-23 Thread Gabor Grothendieck
This can be done readily with zoo. See zoo's 3 vignettes and its help files for commands used below. # setwd("...directory where we have write permission...") # can alternately manually download these two files download.file("https://stat.ethz.ch/pipermail/r-help/attachmen

Re: [R] Point-biserial correlation

2008-07-23 Thread William Revelle
At 10:23 PM +0200 7/23/08, Tobias Verbeke wrote: Angelo Scozzarella wrote: what the command for the point-biserial correlation? Have a look at the polycor package by John Fox. http://cran.r-project.org/web/packages/polycor/index.html HTH, Tobias A point-biserial correlation is just a Pear

Re: [R] Can R fill in missing values?

2008-07-23 Thread Erik Iverson
Hello - Jia Ying Mei wrote: Hi, I know this can be done in Stata (which is quite messy) but I wanted to know if it can be done in R. So lets say I have a merged data set (I used the merge function by date for the attached two files), where all the missing values are filled with NAs (which is

[R] Can R fill in missing values?

2008-07-23 Thread Jia Ying Mei
Hi, I know this can be done in Stata (which is quite messy) but I wanted to know if it can be done in R. So lets say I have a merged data set (I used the merge function by date for the attached two files), where all the missing values are filled with NAs (which is what the all.x=TRUE does).

Re: [R] truncated normal

2008-07-23 Thread Duncan Murdoch
On 23/07/2008 8:17 PM, cindy Guo wrote: Yes, I know. I mean if I want to generate 100 numbers from N(0,1)I((0,1),(5,10)). There are two intervals (0,1) and (5,10). Then the function will give 50 numbers in the first interval and 50 in the other. No, it doesn't handle that case at all. I didn't

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Gad Abraham
Michal Figurski wrote: Thank you all for your words of wisdom. I start getting into what you mean by bootstrap. Not surprisingly, it seems to be something else than I do. The bootstrap is a tool, and I would rather compare it to a hammer than to a gun. People say that hammer is for driving na

Re: [R] how can I write code to detect whether the machine is Windows or Linux?

2008-07-23 Thread Gabor Grothendieck
Ryacas is one package that checks this. Look at this file: http://ryacas.googlecode.com/svn/trunk/R/yacasInstall.R On Wed, Jul 23, 2008 at 5:53 PM, Philip James Smith <[EMAIL PROTECTED]> wrote: > Hi R-People: > > I use 2 machines: a machine with a Windows XP operating system, and another > with

Re: [R] Constrained coefficients in lm (correction)

2008-07-23 Thread Moshe Olshansky
This problem can be easily solved analytically: we want to minimize sum(res(i) -a*st(i) -b*mod(i))^2 subject to a+b=1,a,b>=0, so we want to minimize f(a) = sum((res(i)-mod(i)) - a*(st(i)-mod(i)))^2 for 0<=a<=1 Define Xi = res(i) - mod(i), Yi = st(i) - mod(i), then f(a) = sum(Xi - a*Yi)^2 f(0

Re: [R] Using PrettyR to produce LaTeX output

2008-07-23 Thread Gabor Grothendieck
Using the built in BOD data frame: library(prettyR) str(describe(BOD)) # note Numeric component BOD.describe.df <- as.data.frame(describe(BOD)$Numeric) library(xtable) xtable(BOD.describe.df) On Wed, Jul 23, 2008 at 3:46 PM, jcarmichael <[EMAIL PROTECTED]> wrote: > > Hello everyone. I am new

Re: [R] an extremely simple question

2008-07-23 Thread Michael Kubovy
A cleaner approach than attach()---because you don't need to remember to detach()---is: my.df<-data.frame(cbind(x=runif(100), y=rnorm(100))) head(my.df) with(my.df, plot(y~x)) _ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Bo

Re: [R] Aggregating zoo object with NAs in multiple column

2008-07-23 Thread Achim Zeileis
On Wed, 23 Jul 2008, Abiel Reinhart wrote: I would like to run an aggregation on a zoo object that has multiple series in it, with one of more series having NA values. The problem is that by default the aggregate function will produce an NA value in each aggregated period that contains an NA. Fo

[R] Aggregating zoo object with NAs in multiple column

2008-07-23 Thread Abiel Reinhart
I would like to run an aggregation on a zoo object that has multiple series in it, with one of more series having NA values. The problem is that by default the aggregate function will produce an NA value in each aggregated period that contains an NA. For instance, if I run aggregate(x, as.yearmon(i

Re: [R] FW: average replicate probe values

2008-07-23 Thread jim holtman
Here is one way to do it: > y <- textConnection("UNIQID UniGene Gene 1_SL 2_SL 17_SL 18_SL 38_SL + 1175390 Hs.10095 MLLT1 -0.00595 0.62315 0.85315 1.11215 -0.195 + 1175392 Hs.10101 C1orf166 -0.4945 -0.04025 0.1299 -0.00575 -0.1824 + 1187428 Hs.101014 CEP57 0.60085 0.2564 -0.42885 -0.57635 -0.1473

Re: [R] Time series reliability questions

2008-07-23 Thread Achim Zeileis
On Wed, 23 Jul 2008, John Theal wrote: EViews and Gretl give comparable (and I am inclined to presume, correct) results. R on the other hand, has the exogenous regressor with a negative coefficient. If I use other data I encounter the same problem - agreement between EViews and Gretl, disagree

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Frank E Harrell Jr
Gustaf Rydevik wrote: On Wed, Jul 23, 2008 at 4:08 PM, Michal Figurski <[EMAIL PROTECTED]> wrote: Gustaf, I am sorry, but I don't get the point. Let's just focus on predictive performance from the cited passage, that is the number of values predicted within 15% of the original value. So, the pr

[R] FW: average replicate probe values

2008-07-23 Thread Kaposi-Novak, Pal
From: Kaposi-Novak, Pal Sent: Wednesday, July 23, 2008 5:07 PM To: jim holtman Subject: RE: [R] average replicate probe values Dear Dr Holtman, Thank you very much for your response. What I want is avarege data points in a data.frame from probes which re

Re: [R] Flip Matrix form file?

2008-07-23 Thread Chris82
Thanks a lot, that resolve my probleme! -- View this message in context: http://www.nabble.com/Flip-matrix-from-file--tp18614800p18619853.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.e

[R] path and R CMD check

2008-07-23 Thread Christophe Genolini
Hi the list, When I developpe my code, I put the file that define all the functions in ./MyPack/R/prog.R and the tests in ./MyPack/tests/testsProg.R The test files start by load("../data/myData.rda") source("../R/prog.R") #test function number one... But "R CMD check MyPack" does not find the

Re: [R] how can I write code to detect whether the machine is Windows or Linux?

2008-07-23 Thread Marc Schwartz
on 07/23/2008 04:53 PM Philip James Smith wrote: Hi R-People: I use 2 machines: a machine with a Windows XP operating system, and another with a Linux Ubuntu OS. I transport my code between these 2 machines. However, pathnames to data files always need to be "adjusted" to account for the OS t

Re: [R] how can I write code to detect whether the machine is Windows or Linux?

2008-07-23 Thread Rolf Turner
On 24/07/2008, at 9:53 AM, Philip James Smith wrote: Hi R-People: I use 2 machines: a machine with a Windows XP operating system, and another with a Linux Ubuntu OS. I transport my code between these 2 machines. However, pathnames to data files always need to be "adjusted" to account for

[R] Simulating multilevel responses

2008-07-23 Thread Elke Moons
Dear forum, I was wondering if one could create multilevel responses when at the same time controlling for everything (i.e. for the multilevel structure, the fixed and/or the random effect parameters). What I mean is the following: in an ordinary glm setting you can simulate a binary respons

[R] how can I write code to detect whether the machine is Windows or Linux?

2008-07-23 Thread Philip James Smith
Hi R-People: I use 2 machines: a machine with a Windows XP operating system, and another with a Linux Ubuntu OS. I transport my code between these 2 machines. However, pathnames to data files always need to be "adjusted" to account for the OS that I'm working on. Here is my question: How do

Re: [R] adding the mean and standard deviation to boxplots

2008-07-23 Thread HBaize
Fernando, I don't have time to do all that you asked, but here is some code that makes violin plots with mean, median, and 95% CI. I like this plot very much, even if boxplot purists think it is horrible :-) I think the boxplot was developed before we had computing power. Now we can show the det

[R] R2WinBUGS problem

2008-07-23 Thread Troels Ring
Dear friends - I'm on winXP, R 2.71 - I have with some help dveloped this multivariate normal model, which gives very plausible results in WinBUGS even without any initial values specified. However, when I then try to run the same model via the bugs function in R2WinBUGS with inits specified as

Re: [R] Constrained coefficients in lm (correction)

2008-07-23 Thread Horace Tso
Take a look at the systemfit package. A constraint on a parameter, like the one you described, could be implemented using R*beta0 = q, where R is R.restr and q is q.restr in the function call. I haven't tried it but it's easy to test with some data. Horace -Original Message- From: [E

[R] Weighted variance function?

2008-07-23 Thread Arun Kumar Saha
There is a R function to calculate weighted mean : weighted.mean() under stats package. Is there any direct R function for calculating weighted variance as well? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://s

Re: [R] truncated normal

2008-07-23 Thread Duncan Murdoch
On 7/23/2008 4:22 PM, Duncan Murdoch wrote: On 7/23/2008 3:41 PM, cindy Guo wrote: Hi, I want to generate random samples from truncated normal say Normal(0,1)Indicator((0,1),(2,4)). It has more than one intervals. In the library msm, it seems to me that the 'lower' and 'upper' arguments can only

Re: [R] Point-biserial correlation

2008-07-23 Thread Tobias Verbeke
Angelo Scozzarella wrote: what the command for the point-biserial correlation? Have a look at the polycor package by John Fox. http://cran.r-project.org/web/packages/polycor/index.html HTH, Tobias __ R-help@r-project.org mailing list https://stat.

Re: [R] Using PrettyR to produce LaTeX output

2008-07-23 Thread Austin, Matt
You might look at the summary method in Dr. Harrell's Hmisc package, I believe this would give you almost exactly what you want. latex(summary(gender ~ age + bmi, data=yourdata, method='reverse')) This will get you quartiles, but if you read the documentation (?summary.formula) you can see how

Re: [R] Q re iterating a process and appending results to output file

2008-07-23 Thread jim holtman
Here is one way of doing it: # generate 200 x 2500 samples and then check them c <- qnorm(0.05) i <- 2500 iter <- 200 x <- matrix(rnorm(i * iter, 0, 1) < c,nrow=i) # TRUE/FALSE according to condition # now create the counts x.c <- colSums(x) # write out to a file 1 value on each line cat(x.c, fil

Re: [R] Histogram

2008-07-23 Thread milton ruser
Try see doBy package. Below you have a code on brute force. kind regards, miltinho brazil === number.of.records<-20 my.df<-data.frame(v1=sample(21:34,number.of.records, replace=T), v2=runif(number.of.records), v3=runif(number.of.records)) my.df$v1<-as.numeric(as.character(my.df$v1)) my.df$v

Re: [R] Histogram

2008-07-23 Thread Mark Difford
Hi Angelo, Look carefully at package vcd; and at log-linear models (+ glm(..., family=poisson)). For overdispersion there are more advanced methods. HTH, Mark. Angelo Scozzarella wrote: > > Hi, > > how can I treat data organised in classes and frequencies? > > Ex. > > class frequen

Re: [R] Questions on weighted least squares

2008-07-23 Thread Zhang Yanwei - Princeton-MRAm
I have figured out the problem. Thanks. Sincerely, Yanwei Zhang Department of Actuarial Research and Modeling Munich Re America Tel: 609-275-2176 Email: [EMAIL PROTECTED] -Original Message- From: Zhang Yanwei - Princeton-MRAm Sent: Wednesday, July 23, 2008 3:32 PM To: Zhang Yanwei - Prin

Re: [R] truncated normal

2008-07-23 Thread Duncan Murdoch
On 7/23/2008 3:41 PM, cindy Guo wrote: Hi, I want to generate random samples from truncated normal say Normal(0,1)Indicator((0,1),(2,4)). It has more than one intervals. In the library msm, it seems to me that the 'lower' and 'upper' arguments can only be a number. I tried rtnorm(1,mean=0,sd=1, l

[R] Using PrettyR to produce LaTeX output

2008-07-23 Thread jcarmichael
Hello everyone. I am new to R, so please bear with me. I am trying to find an easy way to export descriptive statistics and other information about my data frame to a LaTeX format. I have found the describe function in PrettyR to be very helpful in producing results in the exact format I'm look

Re: [R] Q re iterating a process and appending results to output file

2008-07-23 Thread Eric C Banfield
Jim, thank you very much This looks like it works. (I just need to study the code and see if I can understand precisely why and how it works.) Eric

Re: [R] Calling LISP programs in R

2008-07-23 Thread Steven McKinney
Have you reviewed the old xlisp machinery that used to be in R? Check out the RXLisp library at http://www.omegahat.org/RXLisp/ and see if this will work. The PDF http://www.omegahat.org/RXLisp/examples.pdf reviews calling xlisp from R. HTH Steve McKinney -Original Message- From: [E

[R] truncated normal

2008-07-23 Thread cindy Guo
Hi, I want to generate random samples from truncated normal say Normal(0,1)Indicator((0,1),(2,4)). It has more than one intervals. In the library msm, it seems to me that the 'lower' and 'upper' arguments can only be a number. I tried rtnorm(1,mean=0,sd=1, lower=c(0,2),upper=c(1,4)) and it didn't w

[R] Constrained coefficients in lm (correction)

2008-07-23 Thread Jorge Ivan Velez
Dear list, In my previous email, the model I'd like to estimate is rea=a*st+b*mod+error, where a+b=1 and a,b>0. My apologies for the misunderstanding. Thanks for all your help, Jorge On Wed, Jul 23, 2008 at 3:35 PM, Jorge Ivan Velez <[EMAIL PROTECTED]> wrote: > > Dear list, > > I have a data

[R] Constrained coefficients in lm

2008-07-23 Thread Jorge Ivan Velez
Dear list, I have a data set which looks like myDF (see below) and I'd like to estimate the linear model rea=a*rea+b*mod+error, where a+b=1 and a,b>0. I tried mymodel=lm(rea~ st + mod-1, data=myDF) summary(mymodel) but I couldn't get what I'm looking for. Also, I tried RSiteSearch("constrained

Re: [R] Questions on weighted least squares

2008-07-23 Thread Zhang Yanwei - Princeton-MRAm
Sorry if I did not state clearly. Put it another way. If the variance of the observation is proportional to the predictor, that is, var(y_i)=x_i*sigma^2, what should be specified in the "weights" argument in the lm function? fit=lm(y~x,weights=???) Sincerely, Yanwei Zhang Department of Actuari

[R] pvclust

2008-07-23 Thread Eben Goodale
Hello there, Here's a question regarding p-values on clusters produced by hierarchical cluster analysis. A web search led me to the program pvclust to tackle this problem. But when I run the problem I get strange results. The 'AU' (approximately unbiased) p-values are very different from the '

Re: [R] Sample on dataframe

2008-07-23 Thread Jarekj
yes, that is thanks milton ruser pisze: I hope this helps my.df<-read.table(stdin(), head=T, sep=" ") V5 V5.1 V5.2 V5.3 V5.4 V5.5 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.846

Re: [R] Histogram

2008-07-23 Thread Henrique Dallazuanna
Try this: with(x, barplot(frequency, names.arg = class)) On Wed, Jul 23, 2008 at 3:29 PM, Angelo Scozzarella <[EMAIL PROTECTED]> wrote: > Hi, > > how can I treat data organised in classes and frequencies? > > Ex. > > class frequency > > 20-23 9 > 23-25

[R] Fw: Using if, else statements

2008-07-23 Thread Gabriela Cendoya
Sorry in the previos replay I forgot monday' scale so weight should be: weight <- c(0.91,1,1,1,1,1.21,1.22) names(weight) <- c("mon","tue","wed","thu","fri","sat","sun") - Original Message - From: "Gabriela Cendoya" <[EMAIL PROTECTED]> To: "Robin Williams" <> Cc: <> Sent: Wednesday, Ju

[R] Point-biserial correlation

2008-07-23 Thread Angelo Scozzarella
Hi, what the command for the point-biserial correlation? Thank Angelo Scozzarella __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and pro

Re: [R] sum each row and output results

2008-07-23 Thread Henrique Dallazuanna
Try this: addmargins(as.matrix(my.df), 2) On Wed, Jul 23, 2008 at 2:43 PM, Rheannon <[EMAIL PROTECTED]> wrote: > > Hello, > > I have the following data frame (DF): > > V5V5.1V5.2 V5.3 V5.4 V5.5 > 2 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.86

Re: [R] Sample on dataframe

2008-07-23 Thread Prof Brian Ripley
All that is needed is my.df[sample(nrow(my.df), size=), ] On Wed, 23 Jul 2008, milton ruser wrote: I hope this helps my.df<-read.table(stdin(), head=T, sep=" ") V5 V5.1 V5.2 V5.3 V5.4 V5.5 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.84665 -6211.06

Re: [R] Can't Load Text Files

2008-07-23 Thread Jia Ying Mei
Hi, Thanks, but I'm not sure I know what you mean by "insert a ENTER after the last value". Do you mean press enter after I write in the last value? Jia Ying Mei milton ruser wrote: setwd("c:\\temp") #you need to insert a ENTER after your last value > df1<-read.table("testinput.txt", hea

Re: [R] Using if, else statements

2008-07-23 Thread Gabriela Cendoya
Hi Robin: I think you can avoid the loops doing this: my.df<-data.frame(d.o.w=sample(c("mon","sat","sun"), 20, replace=T), admissions=rnorm(20)) weight <- c(1,1,1,1,1,1.21,1.22) names(weight) <- c("mon","tue","wed","thu","fri","sat","sun") my.df$NewAdm <- my.df$admissions * w

Re: [R] Sample on dataframe

2008-07-23 Thread milton ruser
I hope this helps my.df<-read.table(stdin(), head=T, sep=" ") V5 V5.1 V5.2 V5.3 V5.4 V5.5 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.718

Re: [R] sum each row and output results

2008-07-23 Thread milton ruser
Like This? my.df<-read.table(stdin(), head=T, sep=" ") V5 V5.1 V5.2 V5.3 V5.4 V5.5 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890

[R] Sample on dataframe

2008-07-23 Thread Jarekj
Hi I'm looking for solution or function which I can use to sample data frame, to obtain new (smaller) data frame similar to sample() function Jarek Jasiewicz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

Re: [R] Histogram

2008-07-23 Thread milton ruser
I don´t know what you means by "treat", but may be you want something like my.df<-read.table(stdin(), head=T, sep=",") class,frequency 20-23,9 23-25,7 26-28,5 29-31,5 32-34,3 rownames(my.df)<-my.df$class barplot (my.df$frequency) axis(1, 1:dim(my.df)[1], rownames(my.df)) Cheers, miltinho astronau

[R] Questions on weighted least squares

2008-07-23 Thread Zhang Yanwei - Princeton-MRAm
Hi all, I met with a problem about the weighted least square regression. 1. I simulated a Normal vector (sim1) with mean 425906 and standard deviation 4. 2. I simulated a second Normal vector with conditional mean b1*sim1, where b1 is just a number I specified, and variance proportional to

[R] Q re iterating a process and appending results to output file

2008-07-23 Thread Eric C Banfield
Greetings. This is very basic but we can't figure it out. The following simple code counts how many values land in the "tail" (below a quantile) of a standardized normal distribution of random numbers. First two commands are inputs: > c <-0.05 > i <-2500 Second two commands are formulas I want

[R] sum each row and output results

2008-07-23 Thread Rheannon
Hello, I have the following data frame (DF): V5V5.1V5.2 V5.3 V5.4 V5.5 2 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 3 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 4 -5890.18905 -6019.84665 -6211.06

Re: [R] Change font-face in title

2008-07-23 Thread Mike Prager
Ok, thanks! "Gabor Grothendieck" <[EMAIL PROTECTED]> wrote: > See ?title where its mentioned that calls are ok and a formula > is a call. Actually the first ~ is not needed since its already > a formula. > > On Tue, Jul 22, 2008 at 1:12 PM, Mike Prager <[EMAIL PROTECTED]> wrote: > > "Gabor Grot

Re: [R] Warning message in if else statement

2008-07-23 Thread Monica Pisica
Hi again, It seems one line in my function came chopped for whatever reason so the if else statement below should be: if (pval==0) p_value <- "<2.2e-16" else p_value <- pval Thanks, Monica > Date: Wed, 23 Jul 2008 13:24:45 -0500> From: [EMAIL PROTECTED]> Subject: Re: > [R] Warnin

[R] Histogram

2008-07-23 Thread Angelo Scozzarella
Hi, how can I treat data organised in classes and frequencies? Ex. class frequency 20-23 9 23-25 7 26-28 5 29-31 5 32-34 3 Thanks Angelo Scozzarella

Re: [R] Combining 4th column from 30 files

2008-07-23 Thread Henrik Bengtsson
A few things that will help you, if not now then in the future: 1) Preallocate the result object. This allow you to avoid using cbind()/rbind(), which constantly creates a new large copy in each iteration. That will eventually bite you if you have a lot of data. In your case you know the number

Re: [R] Quantitative analysis of non-standard scatter plots.

2008-07-23 Thread Daniel Folkinshteyn
I second that - quantile regression seems to be what you want. on 07/23/2008 10:10 AM Ben Bolker said the following: Firas Swidan gmail.com> writes: Hi, I am having difficulties in finding ways to analyse scatter plots and quantitatively differentiate between them. Try quantile regress

Re: [R] Flip Matrix form file?

2008-07-23 Thread Henrik Bengtsson
Hi. On Wed, Jul 23, 2008 at 9:23 AM, Chris82 <[EMAIL PROTECTED]> wrote: > > Hello, > > I have a problem to flip a 200x200 matrix, which is imported by a .asc file. > I want to flip the matrix like in a created example below: > >> b <- matrix(1:9,3,3,byrow=T) >> b > > [,1] [,2] [,3] > [1,]1

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Greg Snow
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Michal Figurski > Sent: Wednesday, July 23, 2008 10:22 AM > To: r-help@r-project.org > Subject: Re: [R] Coefficients of Logistic Regression from > bootstrap - how to get them? > > Thank you all for your

Re: [R] Warning message in if else statement

2008-07-23 Thread Monica Pisica
Hi Erik, Thanks for your answer. I did print the p-value just before the statement and it is only one value – or at least I see only one value ….. that is strange. I am doing a test and I want to see what is it's p-value ….for example my function "myf" is like that: myf <- function(m, se, con

Re: [R] shQuote and cat

2008-07-23 Thread Duncan Murdoch
On 7/23/2008 12:20 PM, Vadim Organovich wrote: Dear R-users, It is my understanding that cat(shQuote(a.string)) should print the origintal a.string. Is this right? No, cat(a.string) should print the original a.string. shQuote(a.string) adds quotes so that a.string can be used in the shell.

Re: [R] Quantitative analysis of non-standard scatter plots.

2008-07-23 Thread Firas Swidan, PhD
How do I check that, and what quantification does it provide? Thanks, Firas. On Wed, 2008-07-23 at 21:20 +0530, Bogaso Cristofer wrote: > Have u checked skewness of data? > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Firas Swidan > Sent: 23 July

Re: [R] Using if, else statements

2008-07-23 Thread milton ruser
Just to clarify, if you have two data.frame, one with your data, other with data-admissions, just use data.merge<-merge(my.df, data.weigth, by.x="data", by.y="data", all=T) miltinho On 7/23/08, milton ruser <[EMAIL PROTECTED]> wrote: > > Hi Rob Williams > > I think it is one way of you do the j

Re: [R] Using if, else statements

2008-07-23 Thread milton ruser
Hi Rob Williams I think it is one way of you do the job. Cheers, miltinho astronauta brazil my.df<-data.frame(cbind(data=sample(c("mon","sat","sun"), 20, replace=T), values=rnorm(20))) my.df$values<-as.numeric(my.df$values) data.weigth<-read.table(stdin(), head=T, sep=",") data,weigt

Re: [R] Warning message in if else statement

2008-07-23 Thread Erik Iverson
Monica - Monica Pisica wrote: Hi, I am using an if else statement inside a function …. If I use that function I have no problems …. If I use the function with the if else statement inside a second function I get the following waring: Warning message: In if (pval == 0) p_value <- "< 2.2e-16" el

Re: [R] Using if, else statements

2008-07-23 Thread Patrick Burns
jjdow <- sample(c('Sun', 'Mon', 'Tues'), 10, replace=TRUE) jjdata <- data.frame(admission=1:10, d.o.w.=jjdow) #> jjdata # admission d.o.w. #1 1 Tues #2 2 Tues #3 3 Tues #4 4Sun #5 5Mon #6 6Mon #7 7Sun #8

Re: [R] Using if, else statements

2008-07-23 Thread jim holtman
One more try and I quit: This is what happens if someone does not sent a sample of data you have to create things on the fly without testing. days <- list(list("Sat", 1.21), list("Sun", 1.22), list("Mon", 0.91)) for (i in days){ .subset <- data$d.o.w == i[[1]] # subset of data that matches

Re: [R] Using if, else statements

2008-07-23 Thread jim holtman
My fingers slipped on the keyboard. Here what they intended to write. This sets up a list of the data and the matches on a subset for processing days <- list(list("Sat", 1.21), list("Sun", 1.22), list("Mon", 0.91)) for (i in days){ .subset <- data$d.o.w == i[[1]] # subset of data that matc

Re: [R] Using if, else statements

2008-07-23 Thread jim holtman
You would have something that looks like this: if (data$d.o.w == "Sat") data$admission <- round(data$admission * 1.21) if (data$d.o.w == "Sun") ... On Wed, Jul 23, 2008 at 11:44 AM, Robin Williams <[EMAIL PROTECTED]> wrote: > Hi all, > > Again I have searched the net and so on, without find

[R] Flip Matrix form file?

2008-07-23 Thread Chris82
Hello, I have a problem to flip a 200x200 matrix, which is imported by a .asc file. I want to flip the matrix like in a created example below: > b <- matrix(1:9,3,3,byrow=T) > b [,1] [,2] [,3] [1,]123 [2,]456 [3,]789 > b1 <- apply(t(b),1,rev) > b1

Re: [R] sequential sum of a vector...

2008-07-23 Thread denise xifaras
Dear Patrizio and all, Do you know a similar approach to this, so that *any* function is sequentially applied on a matrix? Particularly, instead of wanting to sum columns every 8 rows, how could we apply a linear regression to the columns of a matrix every 8 rows? ie, if we have a matrix say of

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Michal Figurski
Thank you all for your words of wisdom. I start getting into what you mean by bootstrap. Not surprisingly, it seems to be something else than I do. The bootstrap is a tool, and I would rather compare it to a hammer than to a gun. People say that hammer is for driving nails. This situation is a

[R] Warning message in if else statement

2008-07-23 Thread Monica Pisica
Hi, I am using an if else statement inside a function …. If I use that function I have no problems …. If I use the function with the if else statement inside a second function I get the following waring: Warning message: In if (pval == 0) p_value <- "< 2.2e-16" else p_value <- pval : the con

[R] shQuote and cat

2008-07-23 Thread Vadim Organovich
Dear R-users, It is my understanding that cat(shQuote(a.string)) should print the origintal a.string. Is this right? I am not sure cat() correctly prints strings which are generated by triple-shQuote(): > shQuote(shQuote("a")) [1] "\"\\\"a\\\"\"" > cat(shQuote(shQuote(shQuote("a"))), '\n') "\"\

[R] Calling LISP programs in R

2008-07-23 Thread francogrex
I have written some programs in Common Lisp and I have been using SAS to pipe those programs to my lisp compiler in batch mode by using the %xlog and %xlst SAS commands. I wonder if there is in R a similar way to pipe commands to LISP so that all my work would be concentrated in R even when I have

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Henrique Dallazuanna
Oh, you are rigth Marc, thanks. Another option is: pats.df <- do.call(rbind.data.frame, pats) On Wed, Jul 23, 2008 at 1:10 PM, Marc Schwartz <[EMAIL PROTECTED]> wrote: > on 07/23/2008 09:42 AM Henrique Dallazuanna wrote: >> >> Try this: >> >> pats.df <- do.call(rbind, pats) > > Henrique, > > Tak

[R] How to control the memory?

2008-07-23 Thread rlearner309
Hi, I have a huge data set to deal with. Sometimes I got warning message about limitation of memory, sometimes R reads in the data but it is very slow. My question is, is there anything I can do to lift the memory limitation (I did memory.limit(4095), anything else I can do?). I know I can also

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Marc Schwartz
on 07/23/2008 09:42 AM Henrique Dallazuanna wrote: Try this: pats.df <- do.call(rbind, pats) Henrique, Take note of the object that results from this: > do.call(rbind, pats) shape shape.col shape.lty cell.fill back.fill label label.size [1,] 0 "black" 1 "white" "white"

[R] Time series reliability questions

2008-07-23 Thread John Theal
Hello all, I have been using R's time series capabilities to perform analysis for quite some time now and I am having some questions regarding its reliability. In several cases I have had substantial disagreement between R and other packages (such as gretl and the commercial EViews package). I

Re: [R] sequential sum of a vector...

2008-07-23 Thread Gustaf Rydevik
On Wed, Jul 23, 2008 at 4:03 PM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi R, > > > > Let, > > > > x=1:80 > > > > I want to sum up first 8 elements of x, then again next 8 elements of x, > then again another 8 elements. So, my new vector should look like: > > c(36,100,164,228,29

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Jorge Ivan Velez
Dear Michael, Perhaps, data.frame(do.call(rbind,lapply(pats,function(x) t(as.matrix(x,ncol=10) HTH, Jorge On Wed, Jul 23, 2008 at 9:23 AM, Michael Friendly <[EMAIL PROTECTED]> wrote: > For a function that takes an argument as a list of lists of parameters, I'd > like to be able to conv

Re: [R] Quantitative analysis of non-standard scatter plots.

2008-07-23 Thread Bogaso Cristofer
Have u checked skewness of data? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Firas Swidan Sent: 23 July 2008 18:38 To: r-help@r-project.org Subject: [R] Quantitative analysis of non-standard scatter plots. Hi, I am having difficulties in finding ways

Re: [R] sequential sum of a vector...

2008-07-23 Thread Henrique Dallazuanna
Maybe: tapply(x, gl(10, 8), sum) or unlist(lapply(split(x, gl(10, 8)), sum)) On Wed, Jul 23, 2008 at 11:03 AM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi R, > > > > Let, > > > > x=1:80 > > > > I want to sum up first 8 elements of x, then again next 8 elements of x, > then again a

Re: [R] sequential sum of a vector...

2008-07-23 Thread William Revelle
At 7:33 PM +0530 7/23/08, Shubha Vishwanath Karanth wrote: Hi R, Let, x=1:80 I want to sum up first 8 elements of x, then again next 8 elements of x, then again another 8 elements. So, my new vector should look like: c(36,100,164,228,292,356,420,484,548,612) I used: aggregate(x,list(rep(1:10

[R] Using if, else statements

2008-07-23 Thread Robin Williams
Hi all, Again I have searched the net and so on, without finding an answer to this surely simple problem. A short bit of code would be appreciated. I have a object named `data' with the following column headings. Date, maxitemp, minitemp, admissions, d.o.w. Where d.o.w. is day of the week,

Re: [R] sequential sum of a vector...

2008-07-23 Thread Jorge Ivan Velez
Dear Shubha, Try this: x=1:80 tapply(x,rep(1:10,each=8),sum) 1 2 3 4 5 6 7 8 9 10 36 100 164 228 292 356 420 484 548 612 HTH, Jorge On Wed, Jul 23, 2008 at 10:03 AM, Shubha Vishwanath Karanth < [EMAIL PROTECTED]> wrote: > Hi R, > > > > Let, > > > > x=1:80 > > > > I want to

Re: [R] sequential sum of a vector...

2008-07-23 Thread Richard . Cotton
> x=1:80 > > I want to sum up first 8 elements of x, then again next 8 elements of x, > then again another 8 elements. So, my new vector should look like: > > c(36,100,164,228,292,356,420,484,548,612) > > I used: > > aggregate(x,list(rep(1:10,each=8)),sum)[-1] > > or > > rowsum(x,group=r

Re: [R] sequential sum of a vector...

2008-07-23 Thread Marc Schwartz
on 07/23/2008 09:03 AM Shubha Vishwanath Karanth wrote: Hi R, Let, x=1:80 I want to sum up first 8 elements of x, then again next 8 elements of x, then again another 8 elements. So, my new vector should look like: c(36,100,164,228,292,356,420,484,548,612) I used: a

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Ben Bolker
Michael Friendly yorku.ca> writes: > > For a function that takes an argument as a list of lists of parameters, > I'd like to be able to convert that > to a data.frame and vice versa, but can't quite figure out how. > [snip data] pats.df <- do.call("rbind",pats) pats2 <- apply(pats.df,1,

Re: [R] sequential sum of a vector...

2008-07-23 Thread Shubha Vishwanath Karanth
Many Thanks Jorge... That was one more way...Is it possible if I can do this without using rep(1:10,each=8) or the groupingbecause I feel the number 8 here is fixed... If there is some technique of tracking the position of first 8, then next 8... don't know whether I am clear in conveying...

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Patrizio Frederic
try ?unlist it may help regards +- | Patrizio Frederic | Research associate in Statistics, | Department of Economics, | University of Modena and Reggio Emilia, | Via Berengario 51, | 41100 Modena, Italy | | tel: +39 059 205 6727 | fax: +39 059 2

  1   2   >