[R] prediction error for test set-cross validation

2009-03-11 Thread Mehmet U Ayvaci
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 + PrinFin+ SkRtr + NpRtr +

Re: [R] Converting a dataframe to a matrix

2009-03-11 Thread Simon Blomberg
xtabs is your friend: xtabs(likes ~ color + name, data=dat) color nameblue green red jake 1 1 0 sally1 1 0 tom 0 0 1 See ?xtabs for more info. Note that I changed the likes? column to just likes. It is a bad idea to have question marks in variable

Re: [R] Converting a dataframe to a matrix

2009-03-11 Thread markleeds
Hi: Below works but it's extremely ugly and overly complicated. i'm sure someone else will send you something better and I'll be waiting also. Also, the way I named the rows and columns works for below but it won't hold in the general case if you don't have nice ordered names like you do

[R] lsmeans in R

2009-03-11 Thread suman Duvvuru
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 package can be used to generate lsmeans. But I tried to

[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,

[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 b...@fas.harvard.edu À :

[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

[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 v...@plan.be À : r-help@r-project.org Envoyé le : Mercredi, 11 Mars 2009, 9h25mn 11s Objet : [R]

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 package can

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

[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] 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. Jim

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

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) rle(x)$values

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

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] 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

[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

[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

[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.

[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

[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 -

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

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 repetitions

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

[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] Date frame

2009-03-11 Thread jim holtman
It is called a list. On Wed, Mar 11, 2009 at 6:32 AM, Tammy Ma metal_lical...@live.com 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

[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

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 you

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

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

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)

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] 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

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 srat...@yahoo.com wrote: Hi all, I am looking for a R function which unables me to plot mean +/- SEM. Is there such a function

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

[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] 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

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:00),

[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?

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

[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)

[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:

[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,

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 christos.hat...@nuverabio.com wrote: Take a look at the elasticnet package. -Christos -Original Message- From: r-help-boun...@r-project.org

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 On

Re: [R] odfWeave xtable still best packages to produce tables

2009-03-11 Thread Max Kuhn
Jason, I found several references to odfWeave and xtable.  My question is, are those still best R packages to produce publication quality tables tables from R? I think the file type you want (and how you will use the output) should probably drive your choice. If you are going to pdf, then

Re: [R] Creating an Excel file with multiple spreadsheets

2009-03-11 Thread Hans-Peter Suter
2009/3/9 Phil Spector spec...@stat.berkeley.edu: The xlsReadWrite package provides write.xls for Windows, but it cannot write _multiple_ spreadsheets -- Regards, Hans-Peter __ R-help@r-project.org mailing list

Re: [R] LDL' Cholesky decomposition

2009-03-11 Thread Terry Therneau
The gchol function in library(kinship) does an LDL decomposition. An updated version has just recently been posted on Rforge, in the bdsmatrix library which is part of survival. temp - matrix(c(1,1,1,1,5,8,1,8,14), 3) gt - gchol(temp) as.matrix(gt) # L [,1] [,2] [,3] [1,]

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

2009-03-11 Thread Gabor Grothendieck
Here is an example. See the three vignettes in zoo: vignette(zoo) and R News 4/1 for info on dates. # assume this input Lines - Date Time Value 01/01/08 00:00:00 1 01/01/08 00:30:00 2 01/01/08 01:00:00 3 01/01/08 01:30:00 4 01/01/08 02:00:00 5 01/01/08 02:30:00 6 01/01/08 03:00:00 7 01/01/08

Re: [R] trying to run odfWeave()

2009-03-11 Thread Max Kuhn
Unzipping ODF file using unzip -o SampleOdf.odt Erreur dans odfWeave(file.in, file.out) : Error unzipping file De plus : Warning message: In system(zipCmd[2], invisible = TRUE) : unzip introuvable I get this question about twice a week. Look at the help file. ?odfWeave says: Since ODF

[R] Bias correction for random forests?

2009-03-11 Thread Zhou Fang
Hi, Way back in 2004, an update to randomForest added an option 'corr.bias'. The explanation was a bit vague, but it turns out it improves RF's predictive fit with my data substantially. But I am having trouble understanding it. Does anyone know what this 'bias correction' actually does? Or

[R] Easy Recall to get ls(..., all.names=TRUE)?

2009-03-11 Thread Szumiloski, John
Dear useRs, I have a utility function which is meant to be a clone of ls(), except with the option all.names=TRUE. Currently however, the function merely consists of a copy of the source code of ls(), except the default value of all.names is different. That approach has the drawback of future

[R] About the merge

2009-03-11 Thread Tammy Ma
hi, All. DateDtime Hour Min Second Rep App_dur 9 2006-02-22 14:36:11 14 36 11 4 1 10 2006-02-22 14:36:12 14 36 12 3 86 11 2006-02-22 14:37:38 14 37 38 0 58 14 2006-02-22 14:38:36 14 38 36 3 1 15 2006-02-22 14:38:37 14 38

[R] Is there any difference between - and =

2009-03-11 Thread Sean Zhang
Dear R-helpers: I have a question related to - and =. I saw very experienced R programmers use = rather than - quite consistently. However, I heard from others that do not use = but always stick to - when assigning valuese. I personally like = because I was using Matabl, But, would like to

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

2009-03-11 Thread soeren . vogel
Thanks to Peter, David, and Michael! After having corrected the coding error, the p values converge to particular value, not necessarily zero. The whole story is, 634 respondents in 6 different areas marked their answer on a 7-step Likert scale (very bad, bad, ..., very good -- later

Re: [R] Mixed models fixed effects

2009-03-11 Thread Emma Stone
Dear All, This may sound like a dumb question but I am trying to use a mixed model to determine the predictors of bat activity along hedges within 8 sites. So my response is continuous (bat passes) my predictors fixed effects are continuous (height metres), width (metres) etc and the random

Re: [R] Mixed models fixed effects

2009-03-11 Thread ONKELINX, Thierry
Hi Emma, Continuous predictors are no problem at all. You can mix both continuous and categorial predictors if needed. I suppose your response are counts (the number of bats that passes)? In that case a generalised linear mixed model is more appropriate. With the lme4 package you could try

Re: [R] Is there any difference between - and =

2009-03-11 Thread Duncan Murdoch
On 3/11/2009 10:18 AM, Sean Zhang wrote: Dear R-helpers: I have a question related to - and =. I saw very experienced R programmers use = rather than - quite consistently. However, I heard from others that do not use = but always stick to - when assigning valuese. I personally like = because

[R] problem with rfImpute (package randomForest)

2009-03-11 Thread lionel fugon
Hello everybody, this is my first request about R so I am sorry if I send it to a bad mail or if I am not very clear. So my problem is about the use of rfImpute from randomForest package. I am interested in imputations of missing values and I read that randomForest can make it. So i write

[R] how to rotate the histogram

2009-03-11 Thread Abelian
Dear all I want to combine two figures on one plot. First figure display the data distribution. The x-axis of first figure is individual's ranking and the y-axis of first figure is probability. However, the second figure is a histogram about probability. In order to make the figure more clearly, i

[R] RServe

2009-03-11 Thread Maxl18
Dear all, I'm trying to use R-functions from Java. I want to use the Package Rserve. Everthing is installed and I can run my Java-testprogramm. ... Rconnection r = new Rconnection(); double[] d = r.eval(rnorm(10)).asDoubleArray(); ... But now I get always arrays with ten 0.0, which is not

[R] Combining math and variables in expression

2009-03-11 Thread socrates
I am trying to get the following line in a plot margin using mtext: 100% Area = 120.000 km^2 Where I intend that 100% Area = is text, 120.000 is a number that varies according to different data, and km^2 should be a neat km-with-superscript-2. The expression function fails me, since it

Re: [R] Creating a directory for my data

2009-03-11 Thread miya
Sorry, I did forget to add what it is I want to get. I wish to get a result like the following: Legend: ID Title 1 Article A 2 Article B 3 Article C 4 Article D ... i Article N -- View this message in context:

Re: [R] adding text and other elements to ggplot2 plots

2009-03-11 Thread hadley wickham
Have a look at the annotations section of http://had.co.nz/ggplot2/book/toolbox.pdf Hadley On Wed, Mar 11, 2009 at 8:44 AM, levyofi levy...@post.tau.ac.il wrote: Hello, I really like the interface and flexibility of the ggplots package. However, I cannot find how to add text to a plot (like

Re: [R] Mixed models fixed effects

2009-03-11 Thread Simon Pickett
Also check out these pdfs http://cran.r-project.org/other-docs.html and try to get your hands on the bible http://www.amazon.co.uk/R-Book-Michael-J-Crawley/dp/0470510242 Simon. Hi Emma, Continuous predictors are no problem at all. You can mix both continuous and categorial predictors if

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

2009-03-11 Thread Greg Snow
Another possibility is the my.symbols function in the TeachingDemos package. You can define a polygon of your arrow (or other symbol), then use my.symbols to add it to an existing graph, the advantage of my.symbols is that the size of the arrow is absolute, not in terms of the scale of the

[R] OT: Likelihood ratio for the randomization/permutation test?

2009-03-11 Thread Mike Lawrence
Hi guRus, My discipline (experimental psychology) is gradually moving away from Null Hypothesis Testing and towards measures of evidence. One measure of evidence that has been popular of late is the likelihood ratio. Glover Dixon (2005) demonstrate the calculation of the likelihood ratio from

Re: [R] Is there any difference between - and =

2009-03-11 Thread David M Smith
On Wed, Mar 11, 2009 at 7:18 AM, Sean Zhang seane...@gmail.com wrote: Dear R-helpers: I have a question related to - and =. I saw very experienced R programmers use = rather than - quite consistently. However, I heard from others that do not use = but always stick to - when assigning

Re: [R] Help on MLInterfaces

2009-03-11 Thread Martin Morgan
Hi Tulgan -- MLInterfaces is a Bioconductor package, so please ask on the Bioc mailing list (the package maintainer is more likely to read that list) https://stat.ethz.ch/mailman/listinfo/bioconductor Martin Tul Gan tul...@ymail.com writes: Hi,   I am trying to use MLearn in

[R] compile under Ubuntu 8.10 (Ibex)

2009-03-11 Thread Terry Therneau
I fired up a new machine last night and loaded Ubuntu 8.10 on it. I then had to add in the usual compiler stuff which is not loaded by default: make, emacs, fortran, c++, etc. I'm having trouble compiling R 2.8 however. I get a message that it cannot figure out how to link f77 and C.

[R] Using a NAMESPACE or the Imports field in DESCRIPTION?

2009-03-11 Thread Wolfgang Koller
Hello list, I am writing a package which builds on a function (foo) of another package. I only need that particular function. What is the state of the art to do this? Do I need a NAMESPACE file in my package? Currently I still don't have one. Or can I do this with the Imports field in my

[R] Two new R courses in April (US)

2009-03-11 Thread David M Smith
REvolution Computing is hosting two new R courses in New York City and Chicago in April. Short descriptions are below, but further information and registration details can be found in the links at: http://blog.revolution-computing.com/2009/03/r-courses-from-revolution-april.html April 1 (New

Re: [R] Combining math and variables in expression

2009-03-11 Thread Greg Snow
tmp - '120.000' mtext(bquote( '100% Area' == .(tmp)~km^2 )) Hope this helps, -- 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-

Re: [R] Using a NAMESPACE or the Imports field in DESCRIPTION?

2009-03-11 Thread Martin Morgan
Hi Wolfgang -- Wolfgang Koller wrote: Hello list, I am writing a package which builds on a function (foo) of another package. I only need that particular function. What is the state of the art to do this? Do I need a NAMESPACE file in my package? Currently I still don't have one. Or can I

Re: [R] Combining math and variables in expression

2009-03-11 Thread David Winsemius
Dear socrates; It did not take me 2.5 hours but it did take longer than I thought it would. I worked off the example given by Henrique Dallazuanna seen at: http://finzi.psych.upenn.edu/R/Rhelp08/archive/120065.html This seems to work: mtext(bquote(100~% ~ Area == ~ .(text.val)~ Km^2),

[R] how to check the model adequacy for a cox proportional hazard model fit?

2009-03-11 Thread li li
Anybody has any suggestion? Thanks! [[alternative HTML version deleted]] __ 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

Re: [R] Question about datatypes/plotting issue

2009-03-11 Thread Oscar Bonilla
David, I struggled with this for a while. I think the problem with the dates I have is that they are not specific dates, they are partial dates. A workaround for that that I got from someone else in the list was: as.Date(paste(x$Date, '1'), '%B %Y %d') to make them specific dates (the

Re: [R] Question about datatypes/plotting issue

2009-03-11 Thread Gabor Grothendieck
Another approach is to use yearmon. e.g. library(zoo) as.yearmon(January 1987, %B %Y) [1] Jan 1987 Thus we can replace the w - line in my example code with: w - zoo(as.matrix(W[-1]), as.yearmon(W[,1], %B %Y)) On Wed, Mar 11, 2009 at 12:48 PM, Oscar Bonilla oboni...@galileo.edu wrote: David,

Re: [R] Mixed models fixed effects

2009-03-11 Thread Mark Difford
Hi Simon, Carefull, someone is likely to tell you that the bible is Pinheiro, J.C., and Bates, D.M. (2000) Mixed-Effects Models in S and S-PLUS, Springer, and that would be much closer to being correct. Others might mention something by Searle. Nothing against Crawley, of course. But it usually

[R] Comparing data frames and keeping non-matches

2009-03-11 Thread Pele
Hi R users, I am trying to compare 2 data frames by subject and match and save the no matches to an object called nomatch, but I am getting unexpected results... Can anyone tell me how to correct the code to get the expected results shown in the last table? Many thanks in advance for your any

Re: [R] OT: Likelihood ratio for the randomization/permutation test?

2009-03-11 Thread Charles C. Berry
On Wed, 11 Mar 2009, Mike Lawrence wrote: Hi guRus, My discipline (experimental psychology) is gradually moving away from Null Hypothesis Testing and towards measures of evidence. One measure of evidence that has been popular of late is the likelihood ratio. Glover Dixon (2005) demonstrate

Re: [R] compile under Ubuntu 8.10 (Ibex)

2009-03-11 Thread Douglas Bates
On Wed, Mar 11, 2009 at 11:11 AM, Terry Therneau thern...@mayo.edu wrote:  I fired up a new machine last night and loaded Ubuntu 8.10 on it.  I then had to add in the usual compiler stuff which is not loaded by default: make, emacs, fortran, c++, etc.  I'm having trouble compiling R 2.8

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

2009-03-11 Thread Kingsford Jones
Also, see # install.packages('sp') example('spplot', package='sp') Kingsford Jones On Wed, Mar 11, 2009 at 9:38 AM, Greg Snow greg.s...@imail.org wrote: Another possibility is the my.symbols function in the TeachingDemos package.   You can define a polygon of your arrow (or other symbol),

Re: [R] compile under Ubuntu 8.10 (Ibex) - Thanks

2009-03-11 Thread Terry Therneau
Thanks for the good replies. 1. build-essential -- this is likely the essential thing that I forgot. I tend to leave running machines alone (for years at a time) so forget things like this. My laptop is Fedore core 6 I think, when the prior laptop died. I did remember bin-utils though.

Re: [R] Multilevel Modeling using glmmPQL

2009-03-11 Thread Howard Alper
Hi, I'm trying to perform a power simulation for a simple multilevel model, using the function glmmPQL in R version 2.8.1. I want to extract the p-value for the fixed-effects portion of the regression, but I'm having trouble doing that. I can extract the coefficients

[R] ets() initialization

2009-03-11 Thread Yagci, Kezban
Hi, I have been working on ets() for exponential smoothing. R initialize the forecast itself to minimize the error, I want to set an initialization value for the first period(such as first period's acutal value). However, I could not find how to do it. Would you please help me? Regards,

Re: [R] Multilevel Modeling using glmmPQL

2009-03-11 Thread Chuck Cleland
On 3/11/2009 11:29 AM, Howard Alper wrote: Hi, I'm trying to perform a power simulation for a simple multilevel model, using the function glmmPQL in R version 2.8.1. I want to extract the p-value for the fixed-effects portion of the regression, but I'm having trouble doing that. I can

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

2009-03-11 Thread HBaize
Luca, I ran your code using SPSS 17.0 and R 2.8.1. I found that the correct date was returned in R using this code: test.df$newdate - as.Date(as.POSIXct(test.df$mydate , origin=1582-10-14)) Also note that SPSS 17.0 is case sensitive in storing variable names, so the R code in your post needs

[R] Iterations of random sampling

2009-03-11 Thread René Pineda
I have a univariate binary (1,0) 230,000 records, I need to make 20,000 iterations of random sampling of a fixed size. Where I put the result of the sum of selected records for each repetition Thank's _ of your life

Re: [R] Forecasting with dlm

2009-03-11 Thread Giovanni Petris
Hi Michael, There was a bug in dlmForecast that I have fixed. While the new version of the package makes its way to CRAN, you can source the attached file, which contains the amended version of dlmForecast. Best, Giovanni Petris Date: Wed, 11 Mar 2009 13:39:36 + From: Michael Pearmain

Re: [R] Is there any difference between - and =

2009-03-11 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: Use - for assignment, and = for function arguments. Then the difference between f( a = 3 ) f( a - 3 ) is clear, and you won't be surprised that a gets changed in the second case. If you use = for assignment, the two lines above will be written as f( a = 3 )

[R] Couple of Questions about Classification trees

2009-03-11 Thread Jen_mp3
So I have 2 sets of data - a training data set and a test data set. I've been doing the analysis on the training data set and then using predict and feeding the test data through that. There are 114 rows in the training data and 117 in the test data and 1024 columns in both. It's actually the

Re: [R] Iterations of random sampling

2009-03-11 Thread Chuck Cleland
On 3/11/2009 3:15 PM, René Pineda wrote: I have a univariate binary (1,0) 230,000 records, I need to make 20,000 iterations of random sampling of a fixed size. Where I put the result of the sum of selected records for each repetition X - rbinom(23, 1, .5) sample.sums - replicate(2,

[R] tracing SV3 methods

2009-03-11 Thread William Dunlap
I would like to put traces on the methods for an SV3 generic and trace() doesn't seem to work. E.g., median(1:10) [1] 5.5 trace(median.default) median(1:10) # expect Tracing median.default ... [1] 5.5 I can tell that median.default is getting called, since a trace on sort() shows

[R] Reshape question.

2009-03-11 Thread rkevinburton
This hopefully is trivial. I am trying to reshape the data using the reshape package. First I read in the data: a2009 - read.csv(Total2009.dat, header = TRUE) Then I trim it so that it only contains the columns that I have interested in: m2009 - melt(a2009,

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

2009-03-11 Thread Ted Harding
Because of a mistake I made in copying code into email, there has been confusion (expressed in some private emails). Hence the corrected version is appended at the end. On 11-Mar-09 00:05:26, Ted Harding wrote: I have modified my example to make it more convincing! See at end. On 10-Mar-09

[R] error.bars

2009-03-11 Thread Sueli Rodrigues
Hi, I'm trying to use the function error.bars, but the program don't find it, and I dont't found any package with this function. Is there some another functin to draw barplots with error bars? Sueli Rodrigues Eng. Agrônoma - UNESP Mestranda - USP/ESALQ PPG-Solos e Nutrição de Plantas Fones

Re: [R] About the merge

2009-03-11 Thread William Dunlap
You can assign a group number to each run of identical values of 'Rep' with firstInRun - with(data, c(TRUE, Rep[-1]!=Rep[-length(Rep)])) group - cumsum(firstInRun) where 'data' is your data.frame's name. Once you've assigned the runs to groups then you can use, e.g., sapply(split()) to

Re: [R] Couple of Questions about Classification trees

2009-03-11 Thread Frank E Harrell Jr
Jen_mp3 wrote: So I have 2 sets of data - a training data set and a test data set. I've been doing the analysis on the training data set and then using predict and feeding the test data through that. There are 114 rows in the training data and 117 in the test data and 1024 columns in both. It's

  1   2   >