Re: [R] books on Time series

2009-06-15 Thread Stefan Grosse
On Sun, 14 Jun 2009 22:30:49 -0300 Antonio Olinto wrote: AO> I would like to receive any suggestion of which is most appropriate AO> for a non-statistician (I am a biologist). Reading only the index I AO> could not evaluate it. AO> reproducible code. I am an economist but maybe also as a biologi

Re: [R] Trouble with optim on a specific problem

2009-06-15 Thread Liviu Andronic
Hello, On 6/16/09, Stu @ AGS wrote: > Error in optim(c(0.66, 0.999, 0.064), pe, NULL, method = "L-BFGS-B") : > > objective function in optim evaluates to length 6 not 1 > > > > pe <- function(c) c[1]*x1*x2^c[2]*x3^c[3] > I would suspect a matrix multiplication issue. In order to minimise you

[R] Trouble with optim on a specific problem

2009-06-15 Thread Stu @ AGS
Hello! I am getting the following errors when running optim() [I tried optim() with 3 different methods as you can see]: Error in optim(c(0.66, 0.999, 0.064), pe, NULL, method = "L-BFGS-B") : objective function in optim evaluates to length 6 not 1 > out <- optim( c(0.66, 0.999, 0.064),

Re: [R] Confidence Bands in Polynomial Regression

2009-06-15 Thread Dylan Beaudette
On Mon, Jun 15, 2009 at 6:57 PM, Ben Amsel wrote: >  Hello R users, > > Given a linear (in the parameters) regression model where one predictor x > interacts with time and time*time (ie, a quadratic effect of time t): > y = b0 + b1(x) + b2(t) + b3(t^2) + b4(x*t) + b5(x*t^2) + e, > > I would like to

Re: [R] Bin Category Labels on Axis

2009-06-15 Thread David Winsemius
The canonical method of creating a numeric value from a factor is to wrap the factor in as.numeric(as.character( (.)) The as.character grabs the value from the factor levels rahter than giving you the internal codings and the as.numeic finishes the job. Set xaxt=FALSE in the plot arguments

[R] Confidence Bands in Polynomial Regression

2009-06-15 Thread Ben Amsel
Hello R users, Given a linear (in the parameters) regression model where one predictor x interacts with time and time*time (ie, a quadratic effect of time t): y = b0 + b1(x) + b2(t) + b3(t^2) + b4(x*t) + b5(x*t^2) + e, I would like to construct 95% confidence bands (optimally, shaded) around thi

Re: [R] reading Excel file

2009-06-15 Thread Gabor Grothendieck
Check out: http://wiki.r-project.org/rwiki/doku.php?id=tips:data-io:ms_windows On 6/15/09, ram basnet wrote: > Dear all, > > I was using older version of R (installed early). I install new version of R > (R.2.9.0) but i could not find package "xlsReadWrite" to read Excel file. Is > there any alte

Re: [R] xtable with longtable is doublespaced, rather than single as intended

2009-06-15 Thread Stephen J. Barr
Found the answer. It seems to work to wrap longtables with this set of commands: \renewcommand{\arraystretch}{0.6} % make a longtable %... \renewcommand{\arraystretch}{1.0} Hope this is useful to someone else. On Mon, Jun 15, 2009 at 5:33 PM, Stephen J. Barr wrote: > Hello, > > Quick R/LaTeX que

[R] xtable with longtable is doublespaced, rather than single as intended

2009-06-15 Thread Stephen J. Barr
Hello, Quick R/LaTeX question. I have the following code within a .Rnw file: <>= cVec <- c("RATE","SVC.PCT","AGR.PCT","IND.PCT","density00") x.big <- xtable(aggregate(qp3[,cVec], list(qp3[,"COURT"]), mean)) colnames(x.big)[1] <- "COURT" print(x.big, tabular.environment="longtable", include.rowna

[R] xtable with longtable is doublespaced, rather than single as intended

2009-06-15 Thread Stephen J. Barr
Hello, Quick R/LaTeX question. I have the following code within a .Rnw file: <>= cVec <- c("RATE","SVC.PCT","AGR.PCT","IND.PCT","density00") x.big <- xtable(aggregate(qp3[,cVec], list(qp3[,"COURT"]), mean)) colnames(x.big)[1] <- "COURT" print(x.big, tabular.environment="longtable", include.rowna

Re: [R] Referencing data frames

2009-06-15 Thread Stavros Macrakis
On Mon, Jun 15, 2009 at 12:38 PM, Payam Minoofar < payam.minoo...@meissner.com> wrote: > ...I would like to have a function acquire an object by reference, and > within the function create new objects based on the original object and then > use the name of the original object as the base for the n

[R] Bin Category Labels on Axis

2009-06-15 Thread jproville
Hi, I'd really appreciate if someone could give me some help or advice about this - I've tried everything I know and am clueless about how to proceed! I've written a script to import ASCII data of raster maps, bin them into categories, calculate the mean values within these bins and plot the tw

Re: [R] Hi

2009-06-15 Thread Henrique Dallazuanna
You can use (*)apply functions: sapply(paste("V1 ~", names(dat)[2:5]), function(f)coef(lm(as.formula(f), data = dat))) Where V1 is your first column and dat is your data.frame object. On Mon, Jun 15, 2009 at 6:42 PM, Oscar Bayona wrote: > Hi I have a simple question. I want to run a "n times"

Re: [R] reading Excel file

2009-06-15 Thread David Scott
Talita Perciano wrote: Hi, The xlsReadWrite package is at the R site in the archive packages in CRAN (http://cran-r.c3sl.ufpr.br/src/contrib/Archive/xlsReadWrite/). You should also take a look at the package RExcelInstaller. Talita I am not sure if there are any updates of the package since i

Re: [R] reading Excel file

2009-06-15 Thread Talita Perciano
Hi, The xlsReadWrite package is at the R site in the archive packages in CRAN (http://cran-r.c3sl.ufpr.br/src/contrib/Archive/xlsReadWrite/). You should also take a look at the package RExcelInstaller. Talita Em Seg, 2009-06-15 às 15:28 -0700, ram basnet escreveu: > Dear all, > > I was using ol

Re: [R] installing the Simple package

2009-06-15 Thread David Winsemius
Go to: http://search.r-project.org/nmz.html search on simple.median.test... two hits: http://finzi.psych.upenn.edu/R/library/UsingR/html/simple.median.test.html http://finzi.psych.upenn.edu/R/library/UsingR/html/00Index.html So you should be looking for the UsingR package ... not the Simpl

[R] installing the Simple package

2009-06-15 Thread Krysta Chauncey
I'm using Verzani's "Using R for Introductory Statistics" to teach a Research Methods in Psych course, and it recommends simple.median.test() for sign tests, which is in the Simple package--but nowhere I can find has ever heard of the Simple package! Anybody ever heard of this function or this pac

[R] reading Excel file

2009-06-15 Thread ram basnet
Dear all,   I was using older version of R (installed early). I install new version of R (R.2.9.0) but i could not find package "xlsReadWrite" to read Excel file. Is there any alternatives to read Excel file ? I hope it should be. I need help although it is minor querry. Thanks in advance.   Sinc

Re: [R] Hi

2009-06-15 Thread Chuck Cleland
On 6/15/2009 5:42 PM, Oscar Bayona wrote: > Hi I have a simple question. I want to run a "n times" a simple linear > regession and save beta in a matrix but I´m not able. > > Imagine: > > Data.txt is a 10*5 file and want to run 4 different stimations always > regressing first column on the rest.

[R] RES: Hi

2009-06-15 Thread Leandro Marino
Try this: mrp <- function(){ r <- list() mr<-matrix(0,4,1) for(i in 1:4){ r[[i]] <- lm(dat(,i+1)~dat(,1)) mr[i,1] <- coefficients(r[[i]]) } mr } Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-90

[R] reducing space between tickmark labels and axes labels

2009-06-15 Thread Eva Schultner
Hello, Does anybody know if it is possible to reduce the spaces between axes labels and axes lables in boxplots? I am trying to fit several plots onto one page ( layout() ) and need to save as much space as possible. I have reduced margins (par(mar)),adjusted font size (cex) and tck, is there a

Re: [R] t.test or wilcox.test?

2009-06-15 Thread stephen sefick
Try both of them and see if they jive. On Mon, Jun 15, 2009 at 6:03 PM, Serebrenik, A. wrote: > Dear all, > > I have two samples that I need to compare. Running Shapiro Wilk normality > test does not allow me to reject the normality assumption neither for the > first sample (p-value = 0.8938) no

[R] t.test or wilcox.test?

2009-06-15 Thread Serebrenik, A.
Dear all, I have two samples that I need to compare. Running Shapiro Wilk normality test does not allow me to reject the normality assumption neither for the first sample (p-value = 0.8938) not for the second one (p-value = 0.07905). So the t.test seems to be applicable. However, the p-value fo

Re: [R] How to do automatical-plotting

2009-06-15 Thread stephen sefick
?dput to make the example code reproducible, and then maybe i can help. Stephen Sefick On Mon, Jun 15, 2009 at 4:42 AM, Mao Jianfeng wrote: > Hi R-listers, > > I am new to R and programming. > > I have a large dataframe composed of two grouping variables (species, > population, with populations n

[R] Hi

2009-06-15 Thread Oscar Bayona
Hi I have a simple question. I want to run a "n times" a simple linear regession and save beta in a matrix but I´m not able. Imagine: Data.txt is a 10*5 file and want to run 4 different stimations always regressing first column on the rest. So I try this: First I run Data on memory This is my

Re: [R] expand data

2009-06-15 Thread Henrique Dallazuanna
Try this: DF <- data.frame(para.A = c(1, 3), para.B = c(2, 4), para.C = c(3, 1), obs1 = c(4, 1), obs2 = c(5, 0), obs3 = c(7, 8)) long <- reshape(DF, direction = 'long', varying=4:6, sep = "") long[order(long$id),] On Mon, Jun 15, 2009 at 4:02 PM, Oliver wrote: > hi, all > > I

Re: [R] Aligning axis values when plotting more than one graph on same axes

2009-06-15 Thread Greg Snow
Here are 3 approaches: barplot( 1:12, xlim=c(0,12), width=1, space=0, names.arg=substr(month.abb,1,1)) lines( (1:12) - 0.5, 1:12, type='b', lwd=2, col='red' ) ### or tmp <- barplot(1:12, names.arg=substr(month.abb, 1,1)) lines( tmp, 1:12, type='b', lwd=2, col='red' ) ### or library(TeachingD

Re: [R] Aligning axis values when plotting more than one graph on same axes

2009-06-15 Thread Steve Murray
Thanks for the replies. This is a simple example which demonstrates exactly the problems I'm facing. As you can see, neither the x or y axes line up consistantly. > barplot(1:12, names.arg=substr(month.abb, 1,1)) > par(new=TRUE) > plot(1:12, 1:12, type="b", lwd=2, col="red", xaxt="n") I'd be

[R] expand data

2009-06-15 Thread Oliver
hi, all I inherited a data set with format like the following: para.A para.B para.C observation.1 observation.2 observation.3 Essentially, the same experiment (with same parameters) are conducted 3 times, with corresponding observations. What are the efficient ways of re-arranging t

Re: [R] Creating a specific skewed distribution

2009-06-15 Thread Greg Snow
Your question is somewhat vague, there are probably an infinite number of distributions that fit your description. Here are 2 possibilities: > tmp <- sample( c(1,30,60), 1000, replace=TRUE, + prob=c(0.10344, 0.9-0.10344, 0.1)) > mean(tmp) [1] 30.00041 > mean(tmp>=60) [1] 0.1001004 > > tmp2

Re: [R] Aligning axis values when plotting more than one graph on same axes

2009-06-15 Thread Greg Snow
Generally using par(new=T) is more complicated than it is worth, try a different method first. One option is to use the updateusr function from the TeachingDemos package. The first example on the help page shows adding a line to a barplot with everything aligned, follow that example as a star

Re: [R] Referencing data frames

2009-06-15 Thread Greg Snow
Well, R does not do references like some other languages do (I am not familiar with Igor). Partly because of the danger that references pose (you don't know if a function has just changed you data or not). If you use environments, then you can work with objects in a reference like manner (but

[R] Cross Correlations for two time series, different # of observations

2009-06-15 Thread Pur_045
Dear All, I am trying to determine the cross correlation between two different time series of data which is collected based on different sampling frequency. i.e (daily data and intraday day). When I plot this data I can clearly see that there is one series lags another, BUT in terms of quantify

Re: [R] axis on a non-uniform scale

2009-06-15 Thread Patrick Connolly
On Mon, 15-Jun-2009 at 04:23AM -0700, deanj2k wrote: |> |> hi everyone, just wondering how i might go about plotting a graph (say using |> the plot() function) where my x axis is plotting points which have |> Log(values) but i want my x axis to display values in exponentiated form |> |> ie. my l

[R] GARCH:: False Convergence

2009-06-15 Thread Pur_045
Dear R users, I am trying to use tseries' garch function in order to determine the volatility of a return series generated by quantmod. Here is the code that I am using: > library(quantmod) > getSymbols("AAPL") convert daily closing prices into continuous log returns > dret<-dailyReturn(AAPL,ty

Re: [R] display SVG, PNG, GIF, JPEG, TIFF, PPM in new plot frame

2009-06-15 Thread baptiste auguie
Hi, the grImport package provides some functionality for svg and postscript graphics, http://cran.r-project.org/web/packages/grImport/index.html Best, baptiste Robbie Morrison wrote: Dear R-help I want to display an image file in a new plot frame. SVG is my preferred format, but I ca

[R] display SVG, PNG, GIF, JPEG, TIFF, PPM in new plot frame

2009-06-15 Thread Robbie Morrison
Dear R-help I want to display an image file in a new plot frame. SVG is my preferred format, but I can also consider PNG, GIF, JPEG, TIFF, and PPM (from ImageMagick). By way of background (although not material to this posting), the image file is generated by a call to 'dot' (part of the 'Graph

[R] Modifying graphs

2009-06-15 Thread Payam Minoofar
Hi, Sorry for the high volume. I'm finding new problems as I resolve old ones. The only remaining issue is modifying the boxplots generated by my function. I have found the various parameters like font.lab, font.main, etc., in the manual, but I cannot figure out where to introduce them. The fu

Re: [R] boxplot size

2009-06-15 Thread luscinia
Yes, I have tried to change plot dimensions using the height and width functions for layout, but this only seems to change the matrix dimensions the plots stay the same size. I am probably doing something wrong, but I don't know what. David Winsemius wrote: > > Have you actually looked at th

Re: [R] Aligning axis values when plotting more than one gr aph on same axes

2009-06-15 Thread Matthieu Dubois
Dear Steve, it will be difficult to help you without the code you are using to produce the plots. Could you please post a complete example with some (possibly generated) data and your code ? Regards, Matthieu Matthieu Dubois Post-doctoral fellow Psychology and NeuroCognition Lab Grenoble,

Re: [R] Referencing data frames

2009-06-15 Thread Wacek Kusnierczyk
Payam Minoofar wrote: > IGOR Pro has a built-in function that returns the name of an object as a > string, and I was wondering if R has a similar facility. > ?substitute ?deparse vQ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] altering a global variable

2009-06-15 Thread jebyrnes
Wow. That's actually quite beautiful. Gratzi - both to you and the authors of the language. Henrique Dallazuanna wrote: > > Try: > > > a <- function(x)m<<-4 > > On Mon, Jun 15, 2009 at 3:10 PM, Jarrett Byrnes > wrote: > > -- View this message in context: http://www.nabble.com/alterin

Re: [R] coxph and robust variance estimation

2009-06-15 Thread Terry Therneau
> It seems that the function anova don't use a robust estimation for the > analysis of deviance. You are correct, anova.coxph always uses the partial likelihood This is a serious oversight, particularly since some of the situations in which the robust variance is recommended are ones where t

Re: [R] A MS-VAR Introduction

2009-06-15 Thread Stefan Grosse
On Mon, 15 Jun 2009 14:21:29 -0300 Henrique wrote: H> I'm starting to learn the MS-VAR methodology and I would like to know H> what I need to download (e.g. packages) to make MS-VAR estimations H> using R. Please, mailing to every mailing list you find does not increase the probability to get he

Re: [R] altering a global variable

2009-06-15 Thread Henrique Dallazuanna
Try: a <- function(x)m<<-4 On Mon, Jun 15, 2009 at 3:10 PM, Jarrett Byrnes wrote: > I'm working on a program that loads several large data files. I'm > using ddply (plyr is really awesome) but I want to minimize the amount > of times a large data file is read in. One solution is to keep trac

Re: [R] Schoenfeld Residuals with tied data

2009-06-15 Thread Terry Therneau
Formally, the Schoenfeld residuals are defined as one residual per event time. I found that when there are tied events, however, that plots of the residuals could be hard to visually interpret: sometimes a residual was large because of a lack of fit at that point, sometimes because several dea

Re: [R] Fitting Mixture of Non-Central Student's t Distributions

2009-06-15 Thread Ingmar Visser
Dear Susanne & Dave, The gamlss package family has an enormous variety of distributions and a function to combine them into mixtures. In particular, the 3 parameter student's t and the 4 parameter generalized t distribution. Hth, Ingmar On 15 Jun 2009, at 17:12, David Hunter wrote: Hi Sus

[R] altering a global variable

2009-06-15 Thread Jarrett Byrnes
I'm working on a program that loads several large data files. I'm using ddply (plyr is really awesome) but I want to minimize the amount of times a large data file is read in. One solution is to keep track of which data file is open with a global variable and then change the currently ope

Re: [R] Help with syntax error

2009-06-15 Thread Gavin Simpson
On Mon, 2009-06-15 at 10:54 -0700, Payam Minoofar wrote: > Hi, > > I have written boxplot commands of this form before, but I don't quite > understand why the function call is reporting a syntax error in this > instance. All parameters passed to the function are strings. You're not seeing the woo

Re: [R] Help with syntax error

2009-06-15 Thread jim holtman
It appears you are missing a ")" gtitle <- paste(names(tframe[x2])," vs. ", names(tframe[x1])) <<== On Mon, Jun 15, 2009 at 1:54 PM, Payam Minoofar wrote: > Hi, > > I have written boxplot commands of this form before, but I don't quite > understand why the function call is reporting a syntax e

[R] S4: Bug in group method defenition ("Compare")

2009-06-15 Thread Vitalie S.
Dear UseRs, Setting methods for groups ("compare" in this case) does not work properly. Once one method is set ,redefining it or even removing does not change the behavior: setClass("foo" ,representation(range="numeric") ) #[1] "foo" setMethod("Compare",c(e1="ANY",e2="foo"),

[R] Help with syntax error

2009-06-15 Thread Payam Minoofar
Hi, I have written boxplot commands of this form before, but I don't quite understand why the function call is reporting a syntax error in this instance. All parameters passed to the function are strings. Thanks in advance. Payam > simplevar <- function(wframe,column1,column2) { + tframe

Re: [R] function inside ifelse

2009-06-15 Thread Stavros Macrakis
Of course functions can be used inside ifelse. They should return vectors. Be careful of the effect of recycling: ifelse(c(F,T,F,T,F,T),1:3,10:20) [1] 10 2 12 1 14 3 with functions: > f<- function(x) x/mean(x) > ifelse(c(F,T,F,T,F,T),sqrt(1:3),f(10:20)) [1] 0.667 1.4142136 0.800 1.0

Re: [R] [OT] VBA to save excel as csv

2009-06-15 Thread Eik Vettorazzi
Hi Hadley, in VBA you can do sth. like Sub save_all_csv() oldName = ThisWorkbook.FullName curpath = ThisWorkbook.Path For Each ws In ActiveWorkbook.Worksheets ws.SaveAs Filename:=curpath & "\" & ws.Name & ".csv", FileFormat:=xlCSV, CreateBackup:=False Next 'bring old file back Workbooks.Op

[R] A MS-VAR Introduction

2009-06-15 Thread Henrique
Dear R community, I'm starting to learn the MS-VAR methodology and I would like to know what I need to download (e.g. packages) to make MS-VAR estimations using R. Best, -- Henrique C. de Andrade Doutorando em Economia Aplicada Universidade Federal do Rio Grande do Sul www.ufrgs.br/ppge ___

Re: [R] [OT] VBA to save excel as csv

2009-06-15 Thread Henrique Dallazuanna
Hi, Try this macro: Sub SaveAllCsv() Dim xl As New Excel.Application Dim wk As New Excel.Workbook Dim s As Excel.Worksheet Dim fso As New FileSystemObject ' You need set the Microsoft Scripting Runtime in References Dim a As File Dim f As Folder Dim pathDir, pathDirOut As String ' Set dir of t

[R] MS-VAR Introduction

2009-06-15 Thread Henrique
Dear R community, I'm starting to learn the MS-VAR methodology and I would like to know what I need to download (e.g. packages) to make MS-VAR estimations using R. Best, Henrique C. de Andrade Doutorando em Economia Aplicada Universidade Federal do Rio Grande do Sul www.ufrgs.br/ppge ___

[R] MS-VAR Introduction

2009-06-15 Thread Henrique
Dear R community, I'm starting to learn the MS-VAR methodology and I would like to know what I need to download (e.g. packages) to make MS-VAR estimations using R. Best, Henrique C. de Andrade Doutorando em Economia Aplicada Universidade Federal do Rio Grande do Sul www.ufrgs.br/ppge [[a

[R] Aligning axis values when plotting more than one graph on same axes

2009-06-15 Thread Steve Murray
Dear R Users, I am trying to plot a barchart with a line graph superimposed (using par(new=TRUE)). There are 12 bars and 12 corresponding points for the line graph. This is fine, except that I'm encountering two problems: 1) The position of the points (of the line graph) are not centred on the

Re: [R] coxph and robust variance estimation

2009-06-15 Thread Liviu Andronic
On 6/15/09, "Sven Knüppel" wrote: > My question is, how can I use robust estimation for the analysis of deviance? > Did you check the Robust Task View and the packages listed in it? Perhaps some would do what you need. Liviu __ R-help@r-project.org mai

Re: [R] lack of memory for logistic regression in R?

2009-06-15 Thread Gavin Simpson
On Mon, 2009-06-15 at 07:35 -0700, Michael wrote: > Yet what's the benefit of using Design Package? Given that glm apparently can't operate within the memory limits of your PC setup on your particular data set/model, perhaps the question should "what do you have to loose in trying Design?" If lrm

[R] mutualInfo() from bioDist package

2009-06-15 Thread Runxuan Zhang
Hi, I try to find a function that calculates the mutual information between two arrays and i found mutualInfo() from bioDist package. when i run the example: x <- matrix(rnorm(100),nrow=5) mutualInfo(x, nbin=3) Then just to try out, i have assigned all the rest rows to the same values as th

Re: [R] NA as a result of using GLM

2009-06-15 Thread Paul Christoph Schröder
Thanks Marc, as you said, this is a priori design. I'm trying to get more events. But for now, I'll have to try to get rid of the collinear genes. Is there any other method than using cor? Any method to state which genes behave in the same manner? Paul Marc Schwartz escribió: > On Jun 15, 2009

Re: [R] function inside ifelse

2009-06-15 Thread Grześ
Grześ wrote: > > Hi, > > Could you tell me, if it's possible to create ifelse and put function > inside, for example: > > code{ > ifelse ((is.na(vek)), call_fun_1(arguments), call_fun_2(arguments)) > > call_fun_1 <- function(arguments) > { sth... > } > } > Ok, I found answer alone! This is

[R] function inside ifelse

2009-06-15 Thread Grześ
Hi, Could you tell me, if it's possible to create ifelse and put function inside, for example: code{ ifelse ((is.na(vek)), call_fun_1(arguments), call_fun_2(arguments)) call_fun_1 <- function(arguments) { sth... } } -- View this message in context: http://www.nabble.com/function-inside-ifelse

Re: [R] Referencing data frames

2009-06-15 Thread Payam Minoofar
You are, indeed, correct. I'm still used to the IGOR Pro programming language (for which I even wrote an introductory manual, http://payam.minoofar.com/igor/) The feedback I've gotten has been fantastic, and I know how I'm going to proceed from this point forward. Nevertheless, I'll solicit mor

Re: [R] Assigning Data a name from within another variable?

2009-06-15 Thread baptiste auguie
Kenny Larsen wrote: Hi All, I have hunted high and low and tried dozens of things but have yet to achieve the result I require. Below is my code (taken mostly from another thread on here) thus far: files<-list.files() files<-files[grep('.wm4', files)] labels<-gsub('.wm4', '',files) for(i in 1:

[R] hands-on book on multivariate statistics and data-mining with R?

2009-06-15 Thread Michael
Hi all, I am looking for pointers to good hands-on books on multivariate statistics and data-mining with R? So that I could learn while doing experiments... Thanks a lot! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] NA as a result of using GLM

2009-06-15 Thread Marc Schwartz
On Jun 15, 2009, at 10:13 AM, Paul Christoph Schröder wrote: > Thanks Marc, as you said, this is a priori design. I'm trying to get > more events. > But for now, I'll have to try to get rid of the collinear genes. Is > there any other method than using cor? Any method to state which > genes

Re: [R] Referencing data frames

2009-06-15 Thread Greg Snow
Generally when someone asks a question like this, they are trying to program in a different language using R rather than taking advantage of the power of R itself. If you give us more information on what you are trying to accomplish, then we may be able to give better advice on how to accomplis

Re: [R] Create R object

2009-06-15 Thread Zhang,Yanwei
Thanks a lot Jim. I just switched back to R from SAS, so I might carry over the old style of creating tons of SAS macro variables... Another related question is : Suppose each element in my lst now is a numeric character: lst=list(a1=rnorm(4), a2=rnorm(4),a3=rnorm(4)) Still the number of el

Re: [R] Assigning Data a name from within another variable?

2009-06-15 Thread jim holtman
Use a 'list' to read in the data and access it: files<-list.files() files<-files[grep('.wm4', files)] labels<-gsub('.wm4', '',files) myInput <- lapply(files, read.table) # if you want to get rid of .wm4 names(myInput) <- sub(".wm4$", "", names(myInput)) On Mon, Jun 15, 2009 at 11:50 AM, Kenny La

Re: [R] how to interpret coefficients for a natural spline smooth function in a GLM

2009-06-15 Thread David Winsemius
Plot the predictions; you can almost never interpret the coefficients of a spline fit individually. They are not really independent or separately interpretable. Is this homework? -- David On Jun 15, 2009, at 10:19 AM, ltracy wrote: Hello- I am trying to model infections counts over 120 mo

[R] [OT] VBA to save excel as csv

2009-06-15 Thread Hadley Wickham
Hi all, This is a little off-topic, but it is on the general topic of getting data in R. I'm looking for a excel macro / vba script that will export all spreadsheets in a directory (with one file per tab) into csv. Does anyone have anything like this? Thanks, Hadley -- http://had.co.nz/ ___

Re: [R] Create R object

2009-06-15 Thread jim holtman
Here is the answer for the second part: > lst=list(a1=matrix(rnorm(4),2,2), a2=matrix(rnorm(4),2,2),a3=matrix(rnorm(4),2,2)) > l.dim <- sapply(lst, dim) > l.dim a1 a2 a3 [1,] 2 2 2 [2,] 2 2 2 > all(l.dim[1,1] == l.dim[1,]) && all(l.dim[2,1] == l.dim[2,]) [1] TRUE > For the first part, w

Re: [R] replacing zeros by NAs

2009-06-15 Thread Mike Prager
Often, data are computed in real (not integer) numbers, and in such cases, comparison to zero is not as good as using a tolerance level. Modifying slightly the suggestions of others, I would use something like this: my.tol <- 1e-50 x <- c(1.4, 2.97, 1.0e-100, pi, 0.2, 5.1, 6.8, 0.0) print(x) is.na

Re: [R] multcomp: contrasts for count data

2009-06-15 Thread Julien Gagneur
Peter Westfall has answered me giving useful links. Here is the exchange: thanks for your quick answer and the refs. My misconception was that i treated the p-values as if they were non adjusted p-values. Discreteness was a minor problem. The p-values look much more uniform once I test on

[R] Create R object

2009-06-15 Thread Zhang,Yanwei
Dear R users, I have two simple questions here, and hope someone can help me on this. Thanks in advance. 1. I have a list object lst=list(a1=matrix(rnorm(4),2,2), a2=matrix(rnorm(4),2,2),a3=matrix(rnorm(4),2,2)). Here I only use three elements for illustration, and in fact the length of lst, n

[R] Assigning Data a name from within another variable?

2009-06-15 Thread Kenny Larsen
Hi All, I have hunted high and low and tried dozens of things but have yet to achieve the result I require. Below is my code (taken mostly from another thread on here) thus far: files<-list.files() files<-files[grep('.wm4', files)] labels<-gsub('.wm4', '',files) for(i in 1:length(files)){ X<-re

Re: [R] NA as a result of using GLM

2009-06-15 Thread poleteiep34
Thanks Marc, as you said, this is a priori design. I'm trying to get more events. But for now, I'll have to try to get rid of the collinear genes. Is there any other method than using cor? Any method to state which genes behave in the same manner? Paul Marc Schwartz escribió: > On Jun 15, 2009

Re: [R] Fitting Mixture of Non-Central Student's t Distributions

2009-06-15 Thread David Hunter
Hi Susanne. The mixtools package does not do this automatically and I would be surprised if there were any package that does. However, it's not in principle too difficult to write code to implement an EM algorithm to search for a maximum likelihood estimator in a finite mixture model. C

Re: [R] NA as a result of using GLM

2009-06-15 Thread Marc Schwartz
On Jun 15, 2009, at 5:54 AM, Paul Christoph Schröder wrote: Hi all! Maybe someone could help me with the following. I know this hasn't directly to do with ecology but I'm also using glm. I have a list of 16 genes and 10 samples. The samples are of two types, 4 Ctrl and 6 Diseased. If, la

Re: [R] Linear Models: Explanatory variables with uncertainties

2009-06-15 Thread vito muggeo
Probably you are looking for EIV (errors-in-variables) or ME (measurement errors) models. "simex" is a possible package which needs to know the error variance.. Also RSiteSearch() may be helpful.. hope this helps, vito kpal ha scritto: One of the assumptions, on which the (General) Linear Mo

[R] R 2.9.1 Scheduled for June 26, 2009

2009-06-15 Thread Peter Dalgaard
This is to announce that we plan to release R version 2.9.1 on Friday, June 26, 2009. Release procedures start Tuesday, June 16. Those directly involved should review the generic schedule at http://developer.r-project.org/release-checklist.html The source tarballs will be made available daily (b

Re: [R] lack of memory for logistic regression in R?

2009-06-15 Thread Frank E Harrell Jr
Michael wrote: Yet what's the benefit of using Design Package? Thanks! For logistic models the code is streamlined. You get automatic tests of most interesting hypotheses (e.g., tests of linearity) and easy to make graphics including nomograms. There's also several model validation functi

Re: [R] lack of memory for logistic regression in R?

2009-06-15 Thread Michael
Yet what's the benefit of using Design Package? Thanks! On Sun, Jun 14, 2009 at 8:04 PM, Frank E Harrell Jr wrote: > Also it would be useful to compare glm with the lrm function in the Design > package, for speed and memory use. > > Frank > > > David Winsemius wrote: >> >> On Jun 14, 2009, at 9:0

Re: [R] Markov chains

2009-06-15 Thread Paul Hiemstra
ilenia fronza wrote: Hi, is there a package to apply Markov chains (order > 1) ? thanks in advance [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posti

[R] NA as a result of using GLM

2009-06-15 Thread Paul Christoph Schröder
Hi all! Maybe someone could help me with the following. I know this hasn't directly to do with ecology but I'm also using glm. I have a list of 16 genes and 10 samples. The samples are of two types, 4 Ctrl and 6 Diseased. If, labelInd<-as.factor(c(rep("0",4),rep("1",6))) genes.glm<-glm(labelIn

[R] how to interpret coefficients for a natural spline smooth function in a GLM

2009-06-15 Thread ltracy
Hello- I am trying to model infections counts over 120 months using a GLM in R. The model is simple really including a factor variable for year (10 yrs in total) and another variable consisting of a natural spline function for time in months. My code for the GLM is as follows: model1<-glm(ALL

[R] How to build phylogenetic tree by R program from distance any distance matrix

2009-06-15 Thread suparna mitra
Hello R users, Can any one please help me to find a way to build phylogenetic tree by R program from any distance matrix. Suppose I have a data like : MATRIX [1] '1'0.0 [2] '2'0.071 0.0 [3] '3'0.036 0.286 0.0 [4] '4'0.429 0.75 0.714 0.0 [5] '5' 0.679 0.179 0.214 0.536 0.0 [6] '

[R] coxph and robust variance estimation

2009-06-15 Thread Sven Knüppel
Hello, I would like to compare two different models in the framework of Cox proportional hazards regression models. On Rsitesearch and google I don't find a clear answer to my question. My R-Code (R version 2.9.0) coxph.fit0 <- coxph(y ~ z2_ + cluster(as.factor(keys))+ strata(stratvar_),

Re: [R] if + is.na

2009-06-15 Thread Grześ
Thank you very much ;) Jeremiah Rounds wrote: > > > Your error message is because "if" wants a single value and you are giving > it a vector. > > > > Typically you want to use functions "all" or any" to correct this error > message (look them up ?all ?any) and eg if(any(is.na(...))) But

Re: [R] NA as a result of using GLM

2009-06-15 Thread David Barron
Because you have 16 variables but only 10 observations. David On Mon, Jun 15, 2009 at 12:09, poleteiep34 wrote: > Hi all! > Maybe someone could help me with the following. I know this hasn't directly > to do with ecology but I'm also using glm. > > I have a list of 16 genes and 10 samples. The

Re: [R] 'Errors' with Ubuntu

2009-06-15 Thread Tony Breyal
Hi Len, I have only just installed Ubuntu 9.04 the other day on my PC (1 HDD, partitioned with Windows Vista Premium) and experienced the Error 22. This would stop me from booting into either Windows or Ubuntu and just be a blank screen with the error message, no way to move forward. I am complet

[R] axis on a non-uniform scale

2009-06-15 Thread deanj2k
hi everyone, just wondering how i might go about plotting a graph (say using the plot() function) where my x axis is plotting points which have Log(values) but i want my x axis to display values in exponentiated form ie. my log values (also scale of the x axis) x axis displays -1

[R] non-english text mining with tm package

2009-06-15 Thread eitan lavi
Hello, I'm having issues working with the tm package on non-english languages. are there any extensions that enable the package to work with Hebrew (and other non-roman letter languages for that matter) ? (e.g. although I can construct a Corpus that shows the hebrew documents alright, I cannot c

Re: [R] a proposal regarding documentation

2009-06-15 Thread John Sorkin
Below I have pasted an example from the R WIKI (which is a copy of a man page), that illustrates a typical problem with the help system. A naive reader who wants to know something about the tcltk package will know little more after reading the page than before he, or she, looked at the page. Quest

[R] Linear Models: Explanatory variables with uncertainties

2009-06-15 Thread kpal
One of the assumptions, on which the (General) Linear Modelling is based is that the response variable is measured with some uncertainties (or weighted), but the explanatory variables are fixed. Is it possible to extend the model by assigning the weights to the explanatory variables as well? Is the

Re: [R] how to obtain lm statistics for multiple subsets

2009-06-15 Thread Gabor Grothendieck
Check out: http://tolstoy.newcastle.edu.au/R/e2/help/07/05/17714.html On Mon, Jun 15, 2009 at 9:26 AM, Cecilia Carmo wrote: > Hi everyone, my data is in a dataframe similar to this but with more firms, > more industries, more years and variables that correspond to financial > information: > >> fir

[R] how to obtain lm statistics for multiple subsets

2009-06-15 Thread Cecilia Carmo
Hi everyone, my data is in a dataframe similar to this but with more firms, more industries, more years and variables that correspond to financial information: firm<-c(rep(1,4),rep(2,4),rep(3,4),rep(4,4)) year<-c(rep(2000:2003,4)) industry<-c(rep(10,4),rep(20,4),rep(10,4),rep(30,4)) X1<-c(10,1

  1   2   >