Re: [R] Cholesky Decomposition in R

2009-03-11 Thread Simon Wood
A <- matrix(runif(25),5,5); A <- A%*%t(A) ## Example +ve def matrix U <- chol(A) ## start from factor given by chol D <- diag(U) ## extract sqrt(D) L <- t(U/D) ## get unit lower triangular factor D <- diag(D^2) ## and diagonal ## So now A = LDL' range(A-L%*%D%*%t(L)) #best, #Simon

Re: [R] Sparse PCA in R

2009-03-11 Thread Kevin Wright
Also look at the pcaMethods package (on Bioconductor). Kevin Wright On Tue, Mar 10, 2009 at 2:59 PM, Christos Hatzis wrote: > Take a look at the elasticnet package. > > -Christos > >> -Original Message- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun...@r-project.org] On Be

[R] Is this a documentation bug? Spss dates import

2009-03-11 Thread Luca Braglia
Hello R-user bug seekers are needed! In order to perform these simple tasks you have to use a copy of SPSS and obviously R. The problem is that date conversion of data coming from SPSS gives wrong results, if we follow ?as.POSIXct ## SPSS dates (R-help 2006-02-17) z <- c(10485849600, 104

[R] adding text and other elements to ggplot2 plots

2009-03-11 Thread levyofi
Hello, I really like the interface and flexibility of the ggplots package. However, I cannot find how to add text to a plot (like the 'text' and 'rect' functions in the graphics package). I will appreciate any suggestions. Thanks, Ofir. -- View this message in context: http://www.nabble.com/addi

[R] Forecasting with dlm

2009-03-11 Thread Michael Pearmain
Hi All, I have a problem trying to forecast using the dlm package, can anyone offer any advise? I setup my problem as follows, (following the manual as much as possible) data for example to run code CostUSD <- c(27.24031,32.97051, 38.72474, 22.78394, 28.58938, 49.85973, 42.93949, 35.92468) libra

Re: [R] chisq.test: decreasing p-value

2009-03-11 Thread David Winsemius
Thanks to Peter Dalgaard for the correct answer. I misinterpreted what R was returning. On Mar 11, 2009, at 7:32 AM, David Winsemius wrote: On Mar 11, 2009, at 6:36 AM, soeren.vo...@eawag.ch wrote: A Likert scale may have produced counts of answers per category. According to theory I may

[R] Ggplot2: saving a grid with multiple plots

2009-03-11 Thread ONKELINX, Thierry
Hi all, I have managed to create a figure on the screen with multiple plots in it. Something like the example below. When I save that with ggsave(), only the last plot gets saved (pPath in the example) instead of the entire figure. Any suggestions how I can save this kind of figures automated? Th

Re: [R] How to monthly,daily,yearly average

2009-03-11 Thread Tammy Ma
Check as.Date > Date: Wed, 11 Mar 2009 06:25:44 -0700 > From: qflic...@yahoo.com > To: r-help@r-project.org > Subject: [R] How to monthly,daily,yearly average > > Sorry, this is my first time to post. > > I have a big data set: first colume is date (ex: 2008-2-150, the second is > time (10:30

Re: [R] Cholesky Decomposition in R

2009-03-11 Thread Ravi Varadhan
You got an "A+" on the homework, Doug! I got a "C-" for suggesting svd(), which clearly doesn't yield a lower (or upper) triangular factorization. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on

[R] How to monthly,daily,yearly average

2009-03-11 Thread Qianfeng Li
Sorry, this is my first time to post. I have a big data set: first colume is date (ex: 2008-2-150, the second is time (10:30:00), and the following columes are variaty measurement data. Every 30 min, I have one data. I want to find an effecient way to calculate the hourly, daily, monthly and

Re: [R] Using napredict in prcomp

2009-03-11 Thread Alain Paquette
Thanks for the answer. Yes indeed, napredict only puts NAs in the right places (ie where na.action was used). Anyway I realize that I'm much better off dealing with the missing values prior to the PCA, and R offers many options for that. Thanks Alain Prof Brian Ripley a écrit : On Tue, 10 M

Re: [R] mean +/- SEM

2009-03-11 Thread Jorge Ivan Velez
Hi Stefo, Perhaps this post might be useful: http://www.nabble.com/error-bars-to22092367.html#a22092367 HTH, Jorge On Tue, Mar 10, 2009 at 6:39 PM, Stefo Ratino wrote: > Hi all, > > I am looking for a R function which unables me to plot mean +/- SEM. Is > there such a function in R? > > Many

Re: [R] t-test, survey data

2009-03-11 Thread Thomas Lumley
On Wed, 11 Mar 2009, Marie Vandresse wrote: *How can I do a t-test with survey data?* The 'survey' package does analysis of survey data. There isn't a t-test function; the easiest way to test for differences in means is with a linear regression model, using svyglm() -thomas Thoma

Re: [R] prediction error for test set-cross validation

2009-03-11 Thread Frank E Harrell Jr
Uwe Ligges wrote: Mehmet U Ayvaci wrote: Hi, I have a database of 2211 rows with 31 entries each and I manually split my data into 10 folds for cross validation. I build logistic regression model as: model <- glm(qual ~ AgGr + FaHx + PrHx + PrSr + PaLp + SvD + IndExam +

Re: [R] Date frame

2009-03-11 Thread Tammy Ma
I have produced the data frame(1) as: starting_timeEnding_time session_1: 14:36:1014:40:44 session_2: 14:40:47 14:41:47 for each session, I produced different sequences as: seq_1<-c(4 ,3, 0 ,3 ,4 ,1, 0 ,1 ,4 ,3 ,4 ,3 ,4) seq_

Re: [R] lsmeans in R

2009-03-11 Thread John Fox
Dear Suman, Chuck Cleland has already pointed you toward a reasonably complete discussion of the topic (thank you Chuck). To update my contribution to that discussion, the effects package now uses t-intervals for models with an estimated dispersion parameter (such as linear models) and will create

Re: [R] (no subject)

2009-03-11 Thread Uwe Ligges
Shuying Yang wrote: Dear Members, I have a question about using R2WinBUGS to obtain the WinBUGS results. By default, when R2WinBUGS returns summary stats, I got mean, sd, 2.5%, 25%, median, 75% and 97.5%. Could anyone tell me how to modify the code to obtain 5% and 95% summary resu

Re: [R] puzzled by math on date-time objects

2009-03-11 Thread Denis Chabot
Hi Phil, Well thank you very much for this detailed explanation. It will help me when summarizing information over periods of time using either summarize (Hmisc) or summaryBy (doBy). Until now, doing so resulted in "mean" time for each "group" being transformed as a number of seconds, as

[R] odfWeave & xtable still best packages to produce tables?

2009-03-11 Thread Jason Rupert
Just a quick question - I did a quick search of the R-search (http://search.r-project.org/nmz.html) [thanks to David Winsemius for recommending this neat R search engine] and R-seek (http://www.rseek.org/) trying to find a package(s) in order to produce publication quality tables. I found se

Re: [R] Date frame

2009-03-11 Thread jim holtman
It is called a "list". On Wed, Mar 11, 2009 at 6:32 AM, Tammy Ma wrote: > > Hi, All, > > How to make a data frame, each row of data frame store the different length > of vector? > > Thanks. > Tammy > > _ > Show them the way! Add map

[R] Making a prediction model from a plot

2009-03-11 Thread joe1985
Hello I have plot looking like this: http://www.nabble.com/file/p22453304/Index%2Bgraf.jpeg Where each continues line corresponds to a period og days, and each break on the line corresponds to a shift in the index level. So what i thought about was, is it possible to make a model predicting

Re: [R] chisq.test: decreasing p-value

2009-03-11 Thread David Winsemius
On Mar 11, 2009, at 6:36 AM, soeren.vo...@eawag.ch wrote: A Likert scale may have produced counts of answers per category. According to theory I may expect equality over the categories. A statistical test shall reveal the actual equality in my sample. When applying a chi square test with i

Re: [R] chisq.test: decreasing p-value

2009-03-11 Thread Peter Dalgaard
soeren.vo...@eawag.ch wrote: > A Likert scale may have produced counts of answers per category. > According to theory I may expect equality over the categories. A > statistical test shall reveal the actual equality in my sample. > > When applying a chi square test with increasing number of repetit

Re: [R] Pseudo-random numbers between two numbers

2009-03-11 Thread Duncan Murdoch
g...@ucalgary.ca wrote: Please forget the last email I sent with the same subject. = I would like to generate pseudo-random numbers between two numbers using R, up to a given distribution, for instance, norm. That is something like rnorm(HowMany,Min,Max,mean,sd) over rnorm(HowMany

[R] Confidence/prediction interval for choice probabilities mlogit

2009-03-11 Thread Tryntsje Wesselius
Hi, I have estimated a multinomial logit model with use of the mlogit-package for my choice data. I predicted the probabilities for each choice, using the formula: pred1 <- exp(B1*X1.1 + B2*X2.1 + B3*X3.1) pred2 <- exp(B1*X1.2 + B2*X2.2 + B3*X3.2) pred3 <- exp(B1*X1.3 + B2*X2.3 + B3*X3.3) sumpred

[R] chisq.test: decreasing p-value

2009-03-11 Thread soeren . vogel
A Likert scale may have produced counts of answers per category. According to theory I may expect equality over the categories. A statistical test shall reveal the actual equality in my sample. When applying a chi square test with increasing number of repetitions (simulate.p.value) over a f

[R] Date frame

2009-03-11 Thread Tammy Ma
Hi, All, How to make a data frame, each row of data frame store the different length of vector? Thanks. Tammy _ Show them the way! Add maps and directions to your party invites. http://www.microsoft.com/windows/windowslive/produc

[R] RES: North Arrow (.png file) on a Map

2009-03-11 Thread Rodrigo Aluizio
Thanks a lot Yihui, It's perfect, in fact exactly identical the I have as a png file in my computer. Thank you so much. Regards Rodrigo -Mensagem original- De: Yihui Xie [mailto:xieyi...@gmail.com] Enviada em: quarta-feira, 11 de março de 2009 02:48 Para: Rodrigo Aluizio Cc: R Help Assun

[R] trying to run odfWeave()

2009-03-11 Thread Lore M
Hi there ! I'm working with windows and R GUI and I'm trying to generate an automatic repport using odfWeave. I have taken the basic template available on line at : http://www.biostat.uzh.ch/services/templates.html which is SampleOdf.odt I've imported the package "odfWeave" and the correspo

Re: [R] Creating a directory for my data

2009-03-11 Thread Uwe Ligges
Hmmm, in fact I do not understand what you are going to do. Can you tell us what the result of your code should look like? Uwe Ligges miya wrote: Hi everyone, I am currently working with a very large data set. It is data collected a few times a day, so there are repeated titles in the data s

Re: [R] prediction error for test set-cross validation

2009-03-11 Thread Uwe Ligges
Mehmet U Ayvaci wrote: Hi, I have a database of 2211 rows with 31 entries each and I manually split my data into 10 folds for cross validation. I build logistic regression model as: model <- glm(qual ~ AgGr + FaHx + PrHx + PrSr + PaLp + SvD + IndExam + Rad +BrDn + BRDS

Re: [R] Barplot -density and multhist x-axis problem

2009-03-11 Thread Jim Lemon
Honorata Kaja Gajda wrote: Thanks in advance for any help I would like to plot a barplot with probability density instead of count frequencies, as is possible in histograms (freq=FALSE). Is this possible? I have tried the following code: with(center,table(light))->light.table barplot(light.tabl

Re: [R] Repeated values

2009-03-11 Thread Chuck Cleland
On 3/11/2009 5:08 AM, Tammy Ma wrote: > Hi,All. > > How to make a program to delete repeated value? > > a example > >> c > [1] 4 3 0 3 4 1 0 1 4 4 3 4 3 4 > > I want to get : 4 3 0 3 4 1 0 1 4 3 4 3 4 > > two 4 is being represented by one 4. x <- c(4, 3, 0, 3, 4, 1, 0, 1, 4, 4, 3, 4, 3, 4)

Re: [R] Repeated values

2009-03-11 Thread Dimitris Rizopoulos
try this: x <- c(4, 3, 0, 3, 4, 1, 0, 1, 4, 4, 3, 4, 3, 4) rle(x)$values I hope it helps. Best, Dimitris Tammy Ma wrote: Hi,All. How to make a program to delete repeated value? a example c [1] 4 3 0 3 4 1 0 1 4 4 3 4 3 4 I want to get : 4 3 0 3 4 1 0 1 4 3 4 3 4 two 4 is being repre

[R] full screen graph, and close x11

2009-03-11 Thread BaKaLeGuM
Hi everybody! I'm looking for a function or option to make a full screen plot.. can you help me? and I would like to know if it's possible to automaticaly close a x11 windows.. because i have more than 100 graph to generate and what i want is: 1 - make a full screen graph 2 - save this plot in

Re: [R] popular R packages

2009-03-11 Thread Jim Lemon
Christos Hatzis wrote: Bioconductor already provides download stats for all packages... http://bioconductor.org/packages/stats/bioc/affy.html Maybe if we asked the Bioconductor people _really_ nicely Jim __ R-help@r-project.org mailing list h

Re: [R] mean +/- SEM

2009-03-11 Thread Jim Lemon
Stefo Ratino wrote: Hi all, I am looking for a R function which unables me to plot mean +/- SEM. Is there such a function in R? Hi Stefo, The "dispersion" function in the plotrix package (among many, many others in other packages) allows you to stick "error bars" onto almost anything. J

[R] Repeated values

2009-03-11 Thread Tammy Ma
Hi,All. How to make a program to delete repeated value? a example > c [1] 4 3 0 3 4 1 0 1 4 4 3 4 3 4 I want to get : 4 3 0 3 4 1 0 1 4 3 4 3 4 two 4 is being represented by one 4. Thanks. Tammy _ More than messages–check out

Re: [R] removing daylight savings in R

2009-03-11 Thread Prof Brian Ripley
On Wed, 11 Mar 2009, Rhiannon Marchant wrote: Hello, Thanks the Prof. Brian Ripley for his earlier response, however I still have a few issues with the times in R. I'd like to somehow set up R so it automatically has the timezone set to Western Australian standard time when I open up

Re: [R] lsmeans in R

2009-03-11 Thread Chuck Cleland
On 3/11/2009 2:45 AM, suman Duvvuru wrote: > I need help with calculating lsmeans (adjusted means) of different terms in > a linear model including the main effect and the interaction effect terms. I > use lm to run the linear models...I previously noted from literature that > that "effects" packag

[R] Re : t-test, survey data

2009-03-11 Thread justin bem
For survey data, the survey package provides methods for variance estimation.  Justin BEM BP 1917 Yaoundé Tél (237) 99597295 (237) 22040246 De : Marie Vandresse À : r-help@r-project.org Envoyé le : Mercredi, 11 Mars 2009, 9h25mn 11s Objet : [R] t-test, survey

[R] t-test, survey data

2009-03-11 Thread Marie Vandresse
*How can I do a t-test with survey data?* Thanks. Marie -- - Le Bureau fédéral du Plan fête ses 50 ans en 2009. Het Federaal Planbureau viert zijn 50-ste verjaardag in 2009. The Federal Planning Bureau celeb

[R] Re : Converting a dataframe to a matrix

2009-03-11 Thread justin bem
Something like this will work m<-matrix(df1$likes, nr=3,nc=3,byrow=T) colnames(m)<-unique(df1$color) rowlnames(m)<-unique(df1$name)  Sincerly. Justin BEM BP 1917 Yaoundé Cameroun Tél (237) 76043774 De : Jennifer Brea À : r-help@r-project.org Envoyé le : Merc

[R] Barplot -density and multhist x-axis problem

2009-03-11 Thread Honorata Kaja Gajda
Thanks in advance for any help I would like to plot a barplot with probability density instead of count frequencies, as is possible in histograms (freq=FALSE). Is this possible? I have tried the following code: with(center,table(light))->light.table barplot(light.table ,col=brewer, freq=FALSE, be

<    1   2