Re: [R] low R square value from ANCOVA model

2012-05-07 Thread peter dalgaard
On May 8, 2012, at 08:34 , array chip wrote: > Thank you Peter, so if I observe a significant coefficient, that significance > still holds because the standard error of the coefficient has taken the > residual error (which is large because large R square) into account, am I > correct? In esse

Re: [R] low R square value from ANCOVA model

2012-05-07 Thread peter dalgaard
On May 8, 2012, at 05:10 , array chip wrote: > Hi, what does a low R-square value from an ANCOVA model mean? For example, if > the R square from the model is about 0.2, does this mean the results should > NOT be trusted? I checked the residuals of the model, it looked fine... It just means tha

Re: [R] R-Code Project Help

2012-05-07 Thread R. Michael Weylandt
Unfortunately, there's a no-homework policy on this list so we can't really give you much help. Googling "simulate blackjack r-project" does turn up some interesting leads though. Best, Michael On Mon, May 7, 2012 at 5:37 PM, Mark G wrote: > Hello, > > I am trying to do a project on R-Code invo

[R] revolution foreach oddity

2012-05-07 Thread pdb
I know this is not a revolution support forum, but as anyone noticed the following? I have a foreach loop to generate random samples. If I run the exact code below in normal r (2.14.1) it works as expected, but if I run it from revolution 4.2.0 each loop returns the same numbers. The only way I c

Re: [R] Using expression() in plot() XXXX

2012-05-07 Thread Rui Barradas
Hello, Try plot(1) text(1, 1.4, expression(bar(X)[cv] == 552.01)) [subscript] and == Hope this helps, Rui Barradas Dan Abner wrote > > Hello everyone, > > I am trying to add the following text (in proper notation) to a > graphic using expression(). > > X-bar (with a subscript of cv) =

[R] R-Code Project Help

2012-05-07 Thread Mark G
Hello, I am trying to do a project on R-Code involving black jack simulations for a class of mine and I need help starting it.  I have tried so many different options and am getting no where and am looking for some help.  If anyone can help me out it would be amazing.  thank you Gabriel

[R] coxph data format

2012-05-07 Thread Ehsan Karim
Dear List, Here is an example of survival data in counting process format (detailed record of each day) > data[data$Id == 11,] # extracted one person's record Id Event Fup Start Stop sex Drug1 601 11 0 6 01 0 0 602 11 0 6 12 0 0 603 11 0 6 2

[R] low R square value from ANCOVA model

2012-05-07 Thread array chip
Hi, what does a low R-square value from an ANCOVA model mean? For example, if the R square from the model is about 0.2, does this mean the results should NOT be trusted? I checked the residuals of the model, it looked fine...   Thanks for any suggestion.   John [[alternative HTML version

Re: [R] Missing Vignettes for reshape2

2012-05-07 Thread R. Michael Weylandt
You might have been thinking of Hadley's webpage for reshape2: http://had.co.nz/reshape/ or the JSS article: http://www.jstatsoft.org/v21/i12 Hope this helps, Michael On Mon, May 7, 2012 at 8:54 PM, Rich Shepard wrote: > On Mon, 7 May 2012, R. Michael Weylandt wrote: > >> What makes you think re

Re: [R] number of Excel worksheets

2012-05-07 Thread William Dunlap
contentsData() will report the names of the "sheets" in an Excel file, or the names of the datasets in a SAS transport file, or the names of the tables in a datbase. importData has a pageNumber argument to let you import from a specific Excel sheet. Bill Dunlap Spotfire, TIBCO Software wdunlap ti

Re: [R] Missing Vignettes for reshape2

2012-05-07 Thread Rich Shepard
On Mon, 7 May 2012, R. Michael Weylandt wrote: What makes you think reshape2 has a vignette? I don't see one on CRAN: http://cran.r-project.org/web/packages/reshape2/index.html Michael, I don't find one there, either. But, I thought that last autumn I read one or two about the package. It w

Re: [R] number of Excel worksheets

2012-05-07 Thread Santosh
Hello experts!! I apologize for posting SPlus related query here..badly in need of relevant info.. I usually use R (and your advice/tips) for my daily work. Was wondering if there is an equivalent of "sheetCount" of the package "gdata" avaailable in Splus 8.2? I would like to get the total number

Re: [R] Matrix "BYTES" size

2012-05-07 Thread jim holtman
If all you want are binary 0/1, then look at the 'bit' package which will let you create a vector of bits. Even for your matrix, you will need almost 1GB of memory to store a copy. On Mon, May 7, 2012 at 5:23 PM, Lucas wrote: > Dear R people. > I惴 facing a big problem. > I need to create a matri

Re: [R] Missing Vignettes for reshape2

2012-05-07 Thread R. Michael Weylandt
What makes you think reshape2 has a vignette? I don't see one on CRAN: http://cran.r-project.org/web/packages/reshape2/index.html Michael On Mon, May 7, 2012 at 6:19 PM, Rich Shepard wrote: >  Running 2.15.0 on Slackware-13.1 with all packages in /usr/lib/R/library. > Package reshape2 is in the

Re: [R] Problem with Median

2012-05-07 Thread David Winsemius
On May 7, 2012, at 5:16 PM, Suhaila Haji Mohd Hussin wrote: Hello. Now the median is solved but then I'm still figuring out how to put the updated column back to replace the original column of the whole data. I'll show you what I meant: Continuing from the previous commands you guys helped

Re: [R] Plotting a raster image

2012-05-07 Thread David Winsemius
On May 7, 2012, at 6:15 PM, stat curio wrote: Hello, I have a data frame which looks like head(d) a1 a2n j col 1 1 1 88341002 11 #E7E7E7 2 1 2 25094882 11 #E7E7E7 3 1 3 16916246 11 #E7E7E7 4 1 4 14289229 11 #E7E7E7 5 1 5 11945929 11 #E7E7E7 6 1 6 8401235 11 #E7E7E

Re: [R] Using expression() in plot() XXXX

2012-05-07 Thread Rolf Turner
The following works for me: plot(1:10) text(4,8,expression(bar(X)[cv]==552.01)) cheers, Rolf Turner On 08/05/12 09:39, Dan Abner wrote: Hello everyone, I am trying to add the following text (in proper notation) to a graphic using expression(). X-bar (with a subscript of

[R] Missing Vignettes for reshape2

2012-05-07 Thread Rich Shepard
Running 2.15.0 on Slackware-13.1 with all packages in /usr/lib/R/library. Package reshape2 is in the library but there are no vignettes seen by R. If this is the result of something I did incorrectly, please point out how to install the vignettes with the package. I can get help for melt and

[R] Plotting a raster image

2012-05-07 Thread stat curio
Hello, I have a data frame which looks like > head(d) a1 a2n j col 1 1 1 88341002 11 #E7E7E7 2 1 2 25094882 11 #E7E7E7 3 1 3 16916246 11 #E7E7E7 4 1 4 14289229 11 #E7E7E7 5 1 5 11945929 11 #E7E7E7 6 1 6 8401235 11 #E7E7E7 The values in 'j' run from 1 to 11. I would li

Re: [R] Using expression() in plot() XXXX

2012-05-07 Thread Jorge I Velez
The code below should have been plot(0, main = expression(bar(X)[cv])) Apologies for the noise. Jorge.- On Mon, May 7, 2012 at 5:44 PM, Jorge I Velez <> wrote: > Hi Dan, > > If I understood correctly, the following will do: > > plot(0, main = expression(bar(X)^{cv})) > > HTH, > Jorge.- > > > >

Re: [R] Using expression() in plot() XXXX

2012-05-07 Thread Jorge I Velez
Hi Dan, If I understood correctly, the following will do: plot(0, main = expression(bar(X)^{cv})) HTH, Jorge.- On Mon, May 7, 2012 at 5:39 PM, Dan Abner <> wrote: > Hello everyone, > > I am trying to add the following text (in proper notation) to a > graphic using expression(). > > X-bar (wit

[R] Using expression() in plot() XXXX

2012-05-07 Thread Dan Abner
Hello everyone, I am trying to add the following text (in proper notation) to a graphic using expression(). X-bar (with a subscript of cv) = XX. Note: Ideally "cv" would be a subscript, but it doesn't have to be. I have the following code: > text(625,.012,expression(bar(X)cv = 552.01)) Error

Re: [R] Matrix "BYTES" size

2012-05-07 Thread Mercier Eloi
See ?sparseMatrix from package Matrix. Eloi On 12-05-07 02:23 PM, Lucas wrote: > Dear R people. > I´m facing a big problem. > I need to create a matrix with 10.000 columns and 750.000 rows. > matrix<- as.data.frame(matrix(data=0L, nrow=75, ncol=1) > as you can see, the data frame has huge

[R] Matrix "BYTES" size

2012-05-07 Thread Lucas
Dear R people. I´m facing a big problem. I need to create a matrix with 10.000 columns and 750.000 rows. matrix<- as.data.frame(matrix(data=0L, nrow=75, ncol=1) as you can see, the data frame has huge dimesions. I was able to find out about thr "L" in data, this way I´m telling that my data

Re: [R] Problem with Median

2012-05-07 Thread Suhaila Haji Mohd Hussin
Hello. Now the median is solved but then I'm still figuring out how to put the updated column back to replace the original column of the whole data. I'll show you what I meant: Continuing from the previous commands you guys helped out I continued as followed: Original Data: http://i1165.

[R] May 12 DEADLINE FAST APPROACHING for useR! 2012

2012-05-07 Thread Frank Harrell
8th Annual International R User Conference useR! 2012, Nashville, Tennessee USA ===> Regular registration rates and most blocks of discounted ===> hotel rooms are available only 5 more days Registration Deadlines: Early Registration: Passed Regular Registration: Mar 1- May 12 Late Registration:

Re: [R] Can't find the error in a Binomial GLM I am doing, please help

2012-05-07 Thread peter dalgaard
On May 7, 2012, at 19:39 , Bert Gunter wrote: > 1. As this is a statistical, rather than an R issue, you would do > better posting on a statistical help site like stats.stackexchange.com > (although some generous soul here may respond). > > 2. You would also probably do better consulting with a

[R] SSfol in nlme

2012-05-07 Thread Ranae
Hello, I am using SSfol in nlme to fit some data for the change of N concentration (N) in plant tissue over time (gdd). The model works nicely for 2 out of 3 treatments, so I would really like to use it, but it consistently has a bad fit for my third treatment. I am pasting the figure for the t

Re: [R] Subtracting a matrix 1x28 from a scalar

2012-05-07 Thread Rui Barradas
Hello, meredith wrote > > Afternoon- > I am trying to subtract a matrix, basically a vector of 28 values, each > by the same number to account for differences in regression fitting. I am > taking the 1x28 and minus it by the mean value of the matrix, each number. > The result I receive is a 1X

[R] Gwet's AC1

2012-05-07 Thread Matt Stati
R has functions for computing kappa, fleiss's kappa, etc., but can it compute Gwet's AC1? Thanks, Matt. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read t

Re: [R] Subtracting a matrix 1x28 from a scalar

2012-05-07 Thread John Kane
I'm sorry but where is 28 coming from? It looks to me like you have a vector of length 34 and the result is of length 34. Oh, I see, the 28 and 29 are the indices for the first number on the line not the total length. John Kane Kingston ON Canada > -Original Message- > From: mmbal..

Re: [R] Subtracting a matrix 1x28 from a scalar

2012-05-07 Thread John Kane
I'm sorry but where is 28 coming from? It looks to me like you have a vector of length 34 and the result is of length 34. Oh, I see, the 28 and 29 are the indices for the first number on the line not the total length. John Kane Kingston ON Canada > -Original Message- > From: mmbal..

Re: [R] Subtracting a matrix 1x28 from a scalar

2012-05-07 Thread meredith
* Disregard message please Afternoon- I am trying to subtract a matrix, basically a vector of 28 values, each by the same number to account for differences in regression fitting. I am taking the 1x28 and minus it by the mean value of the matrix, each number. The result I receive is a 1X29 matri

Re: [R] Subtracting a matrix 1x28 from a scalar

2012-05-07 Thread David Winsemius
On May 7, 2012, at 3:26 PM, meredith wrote: Afternoon- I am trying to subtract a matrix, basically a vector of 28 values, each by the same number to account for differences in regression fitting. I am taking the 1x28 and minus it by the mean value of the matrix, each number. The result I

[R] Subtracting a matrix 1x28 from a scalar

2012-05-07 Thread meredith
Afternoon- I am trying to subtract a matrix, basically a vector of 28 values, each by the same number to account for differences in regression fitting. I am taking the 1x28 and minus it by the mean value of the matrix, each number. The result I receive is a 1X29 matrix. Does anyone know why the r

Re: [R] Problem with Median

2012-05-07 Thread Duncan Murdoch
On 07/05/2012 3:05 PM, Suhaila Haji Mohd Hussin wrote: I might be silly but if I was going to type in dput() then how should I send the data over here? Cut and paste. For example, if I have a dataframe named x and type dput(x), I see structure(list(a = 1:10), .Names = "a", row.names = c(N

Re: [R] Problem with Median

2012-05-07 Thread Suhaila Haji Mohd Hussin
Thank you so much! Suhaila. > Date: Mon, 7 May 2012 15:08:47 -0400 > Subject: Re: [R] Problem with Median > From: jholt...@gmail.com > To: bell_beaut...@hotmail.com > > Your problem is that a.AC is a dataframe: > > > > x <- read.table(text = " a b c class > + 1 12 0 90

Re: [R] Binomial GLM, chisq.test, or?

2012-05-07 Thread Tal Galili
Hi Lincoln, Some thoughts: 1) Did you intend to use "cohort" as a factor and not as a numeric? (at least that is what it looks like in your output) 2) Is there a strong correlation between "cohort" and the other explanatory variables you are trying in your model? Contact Detail

Re: [R] Problem with Median

2012-05-07 Thread Suhaila Haji Mohd Hussin
I might be silly but if I was going to type in dput() then how should I send the data over here? Instead, I've just uploaded the image online, you can access it via the link below. http://i1165.photobucket.com/albums/q585/halfpirate/data.jpg > Date: Mon, 7 May 2012 14:55:24 -0400 > Subject: R

Re: [R] Problem with Median

2012-05-07 Thread Sarah Goslee
Please use dput() to give us your data (eg dput(data) ) rather than simply pasting it in. Sarah On Mon, May 7, 2012 at 2:52 PM, Suhaila Haji Mohd Hussin wrote: > > Hello. > I'm trying to compute median for a filtered column based on other column but > there was something wrong. I'll show how I

[R] Problem with Median

2012-05-07 Thread Suhaila Haji Mohd Hussin
Hello. I'm trying to compute median for a filtered column based on other column but there was something wrong. I'll show how I did step by step. Here's the data: a b c class 1 12 0 90 A-B2 3 9711 A-B3 78 NA123 A-C4 NA NA12A-C5

Re: [R] Problem in executing R-script

2012-05-07 Thread Suhaila Haji Mohd Hussin
Thank Sarah! > Date: Mon, 7 May 2012 14:06:31 -0400 > Subject: Re: [R] Problem in executing R-script > From: sarah.gos...@gmail.com > To: bell_beaut...@hotmail.com > CC: r-help@r-project.org > > Hi Suhaila, > > You don't need to make a function: your script should just contain: > med <- read.cs

Re: [R] Can't find the error in a Binomial GLM I am doing, please help

2012-05-07 Thread lincoln
Perhaps I haven't explained it that well as I would have liked to. To me this was an R issue because I didn't understand why the binomial GLM is getting these results and I believed this was something due to the way I am implementing it in R, not to the binomial GLM itself. If I was wrong and this

Re: [R] Problem in executing R-script

2012-05-07 Thread Berend Hasselman
On 07-05-2012, at 19:41, Suhaila Haji Mohd Hussin wrote: > > Hello. I'm a newbie here. > In my script (I name it readData.R), I wrote the followings: > readData <-function(){med = read.csv("medicalData.csv");} > Then I tested the script by 'Source R Code' then on the command I typed > '

[R] Ranked predictor and response variable analysis

2012-05-07 Thread Joseph Dauer
Hello, I have an experimental design where I would like to use separate ranking events to predict an independent ranking event. I have been using function clmm in the ordinal library but now realize that I am violating one of the assumptions. I have included a subset of the data. I am looking a

Re: [R] correlation between XY coordinates

2012-05-07 Thread David L Lorenz
Chris, I think that you really need to quantify what you mean by correlation. Things to consider would depend on what the matrices represent--are they the estimates of the same set of N geographic points, are they traces of the same line, are they traces of the same polygon outline? If either

Re: [R] Problem in executing R-script

2012-05-07 Thread Sarah Goslee
Hi Suhaila, You don't need to make a function: your script should just contain: med <- read.csv("medicalData.csv") If you do want to make a function, then you need to assign the resulting value to something, eg: med <- readData() but there's no reason to do that. Values that are assigned within

Re: [R] Problem in executing R-script

2012-05-07 Thread R. Michael Weylandt
R is a functional language so, by default, assignments (and other things) within function scope doesn't have global effects. This is generally considered a _very good thing_ in language design. You'd perhaps prefer something like: readData <- function() { read.csv("medialData.csv") } med <- r

[R] Problem in executing R-script

2012-05-07 Thread Suhaila Haji Mohd Hussin
Hello. I'm a newbie here. In my script (I name it readData.R), I wrote the followings: readData <-function(){ med = read.csv("medicalData.csv");} Then I tested the script by 'Source R Code' then on the command I typed 'readData()' then I typed 'med' to check if the variable contains the medical

Re: [R] Can't find the error in a Binomial GLM I am doing, please help

2012-05-07 Thread Bert Gunter
1. As this is a statistical, rather than an R issue, you would do better posting on a statistical help site like stats.stackexchange.com (although some generous soul here may respond). 2. You would also probably do better consulting with a local statistical resource if available, as it is difficul

[R] Can't find the error in a Binomial GLM I am doing, please help

2012-05-07 Thread lincoln
Hi all, I can't find the error in the binomial GLM I have done. I want to use that because there are more than one explanatory variables (all categorical) and a binary response variable. This is how my data set looks like: > str(data) 'data.frame': 1004 obs. of 5 variables: $ site : int 0 0

[R] Panel MNP

2012-05-07 Thread Rajesh Paleti
Hi All, Sorry for posting the same question again. I was not sure if the message was sent initially since it was my first post the forum. Can the MNP package available in R be used to analyze panel data as well? *i.e., *if there are 3 observed discrete choices for three time periods for the same

Re: [R] How to read ANOVA output

2012-05-07 Thread Robert Baer
Hey all who have responded to this post. I am a newbie to ANOVA analysis in R, and let me tell you- resources for us learners are scant, horrible, unclear, imprecise.. in other words.. the worst ever. So advice like "go look it up" in your "classical" textbook or on google is not helpful at all. I

[R] predicted values of coxme model

2012-05-07 Thread allan debelle
Hello I need to use a coxme model with my data (survival analysis with right-censoring and hierarchical nesting), but I cant find a way to get predicted values from a new data table (or even from the original one). Has anyone had this problem before? I cant find anything about that anywhere. Tha

Re: [R] Statistical power of correlations.

2012-05-07 Thread Collin Lynch
Thank you Arun! Collin. On Mon, 7 May 2012, arun wrote: > Hi Collin, Look in the package 'pwr' for 'pwr.r.test'. A.K. - Original Message - From: Collin Lynch To: r-help@r-project.org Cc: Sent: Monday, May 7, 2012 1:44 AM Subject: [R] Statistical power of correlations. My apo

Re: [R] Statistical power of correlations.

2012-05-07 Thread Collin Lynch
Great thanks Peter! Collin. On Mon, 7 May 2012, peter dalgaard wrote: > > On May 7, 2012, at 07:44 , Collin Lynch wrote: > > > My apologies for the statistical naivete of my question but... > > > > Is there an established method or calulating the statistical power of a > > correlation te

Re: [R] Repeating

2012-05-07 Thread efulas
Thank you for replies. I sort out the problem by defining the reassign matrix. Best Wishes, efulas -- View this message in context: http://r.789695.n4.nabble.com/Repeating-tp4614371p4615072.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Topic Modeling- package lda

2012-05-07 Thread ankit sethi
Hi David, I am sorry for cross posting. I will keep this in mind next time. Regarding details, my doubt is regarding the documentation in the package where, it speaks about applying the function to held-out words but the input parameters don't take new datasets, rather they use the output generated

Re: [R] substr not by position but by symbol

2012-05-07 Thread Rui Barradas
Hello, YN wrote > > Hi all, > > One of my variables looks like this: > > .7_-.3_-.2_.9 > > And this is a character variable. I made this by combining four different > number like .7, -.3, -.2, and .9 using paste function. > Now, I want to go back to original format from this one combined char

Re: [R] Dates in R

2012-05-07 Thread Rui Barradas
Oops, Sorry, wrong number. x <- 20101020 as.Date(as.character(x), format="%Y%m%d") as.POSIXct(as.character(x), format="%Y%m%d") Rui Barradas -- View this message in context: http://r.789695.n4.nabble.com/Dates-in-R-tp4614266p4614756.html Sent from the R help mailing list archive at Nabble.co

Re: [R] Repeating

2012-05-07 Thread Rui Barradas
Hello, efulas wrote > > By the way, my "for" function is below, I can't find the mistake > > > rand.max.t<- function(n){ > f<-rep(NA,n) > > for (i in 1:n) { > reassign[i]<-matrix(c(sample(id),data1),203,3) > new.data<-reassign[,1] > random.cas=reassign[new.data==0,2:3] > random.con=reassign[

Re: [R] Dates in R

2012-05-07 Thread Rui Barradas
Hello, Try x <- 20102010 as.Date(as.character(x), format="%Y%d%m") [1] "2010-10-20" as.POSIXct(as.character(x), format="%Y%d%m") [1] "2010-10-20 BST" Note that you must pass x as a character vector. If not, the date functions will see it as the number of days since an origin such as 1970-01-01

Re: [R] Taking a lead in panel data

2012-05-07 Thread Liviu Andronic
On Mon, May 7, 2012 at 3:21 PM, Apoorva Gupta wrote: > Dear R users, > I am working with panel data and I want the difference of a variable with > its t+1 value. > > Could you tell me if such a function exists in the plm package? > Perhaps diff() or lag(). See the plm vignette. Liviu _

Re: [R] metafor

2012-05-07 Thread Jin Choi
I tried the subset argument as Michael suggested, which led to the same results. The results between meta-regression and subgroup analyses were only slightly different as Wolfgang had suggested. I also believe that these minor differences must be arising from the use of random effects. Thank you v

Re: [R] How to plot PCA output?

2012-05-07 Thread Christian Cole
Hi Bryan, On 07/05/2012 15:33, "Bryan Hanson" wrote: >I don't know the answer, Jessica gave some insight. > >I avoid the biplot at all costs, because IMHO it violates one of the >tenets of good graphic design: It has two entirely different scales on >axes. These are maximally confusing to the

Re: [R] How to plot PCA output?

2012-05-07 Thread Christian Cole
Hi Jessica, Yes, that does help. It confirms my digging around in the prcomp object. I was plotting $x, but wasn't sure whether this was appropriate. Mainly because the data ranges are different in $x than when plotted by biplot() - as I mentioned my reply to Bryan. Do you know if this difference

Re: [R] How to plot PCA output?

2012-05-07 Thread Christian Cole
Hi Jessica, THanks for pointing that out. The scaling in biplot() doesn't seem to make sense to me, however. The default value for scale=1 therefore lambda ^ (1-scale) -> lambda ^ 0 which is 1 regardless of what lambda is. Which can't be right? Anyway, I won't worry about it anymore as you and B

Re: [R] commenting out a block of R code

2012-05-07 Thread David L Carlson
In RStudio select the lines to be commented (or uncommented) and press Ctrl+/ or select comment/uncomment on the Edit menu tab -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Me

Re: [R] How to plot PCA output?

2012-05-07 Thread Christian Cole
Hi Bryan, Many thanks for the replies. The data is gene expression data for 36 samples over 11k genes. I see that I can plot PC1 vs PC2 by using $x, but compared to biplot() I can see that the range of values are different. For example, if I use plot() the PC1 scale ranges from -150 to 150 wher

Re: [R] Repeating

2012-05-07 Thread David Winsemius
On May 7, 2012, at 6:28 AM, efulas wrote: By the way, my "for" function is below, I can't find the mistake rand.max.t<- function(n){ f<-rep(NA,n) for (i in 1:n) { reassign[i]<-matrix(c(sample(id),data1),203,3) new.data<-reassign[,1] random.cas=reassign[new.data==0,2:3] random.con=reassign[ne

Re: [R] Repeating

2012-05-07 Thread R. Michael Weylandt
I don't see anything that looks like it should throw an error, but I haven't tested your code without "data1" and "id" -- you might look at ? replicate() though -- it's designed for these sorts of things. E.g., replicate(100, mean(rexp(50))) gets me a hundred draws of the mean of 50 random expone

Re: [R] How to plot PCA output?

2012-05-07 Thread Bryan Hanson
I don't know the answer, Jessica gave some insight. I avoid the biplot at all costs, because IMHO it violates one of the tenets of good graphic design: It has two entirely different scales on axes. These are maximally confusing to the end-user. So I never use it. If it is gene expression dat

Re: [R] wireframe and par(mfrow)

2012-05-07 Thread Simone Gabbriellini
Thanks a lot for pointing me to that! Best, Simone 2012/5/7 David Winsemius : > > On May 7, 2012, at 7:15 AM, Simone Gabbriellini wrote: > >> Hello List, >> >> I have some plots with the wireframe() function, and I'd like to >> display them in a single jpeg file. I know that par(mfrow=c(x,y)) wil

Re: [R] wireframe and par(mfrow)

2012-05-07 Thread David Winsemius
On May 7, 2012, at 7:15 AM, Simone Gabbriellini wrote: Hello List, I have some plots with the wireframe() function, and I'd like to display them in a single jpeg file. I know that par(mfrow=c(x,y)) will divide my display window in x rows and y columns, and although this works with plot(), it l

Re: [R] How to plot PCA output?

2012-05-07 Thread Jessica Streicher
And i always forget the question.. I haven't understood biplots a 100%, but from what i gleaned this scaling is done so it looks better/is easier to read, while the scaling retains certain properties of the biplot (something about projecting). If you want to use the data for anything else, i wo

Re: [R] How can I brake a label in two lines when using expression()?

2012-05-07 Thread David Winsemius
On May 7, 2012, at 6:20 AM, Beatriz De Francisco wrote: I making an xyplot and the y label is too long and needs to be in two rows, but when I brake it there is a huge gap between the last text string and the expression, and I can't get rid of it. Any ideas? My first idea would be that y

Re: [R] How to plot PCA output?

2012-05-07 Thread Jessica Streicher
Biplot, depending on what parameters you give it, scales the data in a certain way. See http://stat.ethz.ch/R-manual/R-patched/library/stats/html/biplot.princomp.html scale The variables are scaled by lambda ^ scale and the observations are scaled by lambda ^ (1-scale) where lambda are the sin

Re: [R] substr not by position but by symbol

2012-05-07 Thread Ista Zahn
Hi YN, I use strsplit for this: x <- ".7_-.3_-.2_.9" > strsplit(x, split = "_") [[1]] [1] ".7" "-.3" "-.2" ".9" > strsplit(x, split = "_")[[1]][3] [1] "-.2" Best, Ista On Mon, May 7, 2012 at 9:54 AM, YN Kim wrote: > Hi all, > > One of my variables looks like this: > > .7_-.3_-.2_.9 > > And

[R] New book: Zero Inflated Models and GLMM with R

2012-05-07 Thread Highland Statistics Ltd
Apologies for cross-posting Members of this mailing list may be interested in the following book: Zero Inflated Models and Generalized Linear Mixed Models with R. Zuur, Saveliev, Ieno. (2012) This book is only available from: http://www.highstat.com/book4.htm Kind regards, Alain Zuur -- D

[R] substr not by position but by symbol

2012-05-07 Thread YN Kim
Hi all, One of my variables looks like this: .7_-.3_-.2_.9 And this is a character variable. I made this by combining four different number like .7, -.3, -.2, and .9 using paste function. Now, I want to go back to original format from this one combined character variable. For instance, I want to

[R] Topic Modeling- package lda

2012-05-07 Thread ankit sethi
Hello, I have been using 'lda' package for topic modeling and wish to predict new topics using a fitted model by giving new dataset as input. While doing this, I came across the function predictive.distribution(). But I am not able to apply it on a new dataset as the input parameter asks for docume

Re: [R] How to plot PCA output?

2012-05-07 Thread Bryan Hanson
Christian, is that 36 samples x 11K variables? Sounds like it. Is this spectroscopic data? In any case, the scores are in the list element $x as follows: answer <- prcomp(your matrix) answer$x contains the scores, so if you want to plot the 1st 2 pcs, you could do plot(answer$x[,1], answer$x

Re: [R] How to plot PCA output?

2012-05-07 Thread Jessica Streicher
To add: If thats not it, maybe you could be a bit more specific about what you consider the "result", and how you want it visualized. Am 07.05.2012 um 15:24 schrieb Jessica Streicher: > That depends on what you want to plot there. Basically, you could just use > plot() with pcaResult$x. You mig

Re: [R] Dates in R

2012-05-07 Thread Uwe Ligges
On 07.05.2012 10:24, BrittD wrote: Hi everyone, I have a file in which the dates are subscribed as for instance: 20101020. This is 20th Octobre 2010. strptime("20101020", format="%Y%m%d") seems to work for me... UWe Ligges My problem is that R won't except this as a date, since there is

Re: [R] How to plot PCA output?

2012-05-07 Thread Jessica Streicher
That depends on what you want to plot there. Basically, you could just use plot() with pcaResult$x. You might need to define which PCs you want to plot there though. pcaResult<-prcomp(iris[,1:4]) plot(pcaResult$x) # gives the first 2 PCs plot(pcaResult$x[,2:3]) #gives the second vs the 3rd PC o

[R] Taking a lead in panel data

2012-05-07 Thread Apoorva Gupta
Dear R users, I am working with panel data and I want the difference of a variable with its t+1 value. For example, I have a data frame as below. > a <- data.frame(c(rep(2,5), rep(3,5)), c(2005:2009, 2004:2008), c(NA,10,34,23,12, 23,45, NA, 45, NA)) > colnames(a) <- c("firm","year","var") I want

Re: [R] Statistical power of correlations.

2012-05-07 Thread arun
Hi Collin, Look in the package 'pwr' for 'pwr.r.test'. A.K. - Original Message - From: Collin Lynch To: r-help@r-project.org Cc: Sent: Monday, May 7, 2012 1:44 AM Subject: [R] Statistical power of correlations. My apologies for the statistical naivete of my question but... Is there a

Re: [R] Pasting with Quotes

2012-05-07 Thread Josh Browning
Thank you both so much for your help! I ended up using bquote(expression(...)), and it's working perfectly! On Sat, May 5, 2012 at 1:05 PM, David Winsemius wrote: > > On May 5, 2012, at 2:42 PM, Josh Browning wrote: > > Hello useRs! >> >> So, I have a random question. I'm trying to build a cha

Re: [R] Repeating

2012-05-07 Thread efulas
By the way, my "for" function is below, I can't find the mistake rand.max.t<- function(n){ f<-rep(NA,n) for (i in 1:n) { reassign[i]<-matrix(c(sample(id),data1),203,3) new.data<-reassign[,1] random.cas=reassign[new.data==0,2:3] random.con=reassign[new.data==1,2:3] f<- list(x=random.cas[,1],y=ra

[R] How to plot PCA output?

2012-05-07 Thread Christian Cole
I have a decent sized matrix (36 x 11,000) that I have preformed a PCA on with prcomp(), but due to the large number of variables I can't plot the result with biplot(). How else can I plot the PCA output? I tried posting this before, but got no responses so I'm trying again. Surely this is a commo

[R] R CMD check, interfacing c++ linking errors

2012-05-07 Thread Zalan Szakolci
Hi there, I am trying to interface c++ code in R and make a package. With R CMD SHLIB the dll was created, but when I try R CMD check, I am getting 'undefined reference to..' linkage error messages. The relevant c++ source from conf-infomap.cpp: #include "conf-infomap.h" #include "R.h" // R fu

[R] FW: Overlapping area Script

2012-05-07 Thread alice Hughes
Dear All I would really appreciate some help with a script which a colleague wrote for me, but I am having problems running (and have not been able to contact my colleague). The script is designed to compare the area of suitable habitat in binary projections of a large number of species c

[R] Repeating

2012-05-07 Thread efulas
Dear All, I have a codes which calculates the result of Ripley's K function of my data. I want to repeat this process 999 times. However, i am getting an error when i use the "for i in" function. Is there any way to repeat this analysis 999 times. Here are the codes i used ; data4 <- matrix(c(s

[R] Dates in R

2012-05-07 Thread BrittD
Hi everyone, I have a file in which the dates are subscribed as for instance: 20101020. This is 20th Octobre 2010. My problem is that R won't except this as a date, since there is no sign to seperate the Year, Month and Day and that it will only see it as an origin, which it is not. Does anyone k

Re: [R] what is Non-numeric argument to mathematical function in prediction ?

2012-05-07 Thread kiinalist
Thanks. It does work now. I also get another problem when I use naivebayes and prediction in myapplication There was anerror message: Error in table(predict(nb.obj, test.data[, subset, drop = FALSE]), test.data[, : all arguments must have the same length The length of test.data[,subset

Re: [R] y-axis-problem (barplots)

2012-05-07 Thread E Atescelik
And if the y-axis starts with 0: Instead of ylim=c(1,2), you take ylim=c(0,2). Thus barplot(x[,1], ylim=c(0,2)) Hopefully it is now correct. Kind regards,Esra Atescelik > Date: Mon, 7 May 2012 09:55:06 +0200 > From: stude...@gmail.com > To: r-help@r-project.org > Subject: [R] y-axis-problem (b

Re: [R] Binomial GLM, chisq.test, or?

2012-05-07 Thread lincoln
Thanks Tal for answering, Anyway I still have no idea on why the binomial GLM is missing the relationship between the response variable and the explanatory variable "cohort". Is there anyone who might help me to understand this? -- View this message in context: http://r.789695.n4.nabble.com/Bi

Re: [R] how to deduplicate records, e.g. using melt() and cast()

2012-05-07 Thread Jan van der Laan
using reshape: library(reshape) m <- melt(my.df, id.var="pathway", na.rm=T) cast(m, pathway~variable, sum, fill=NA) Jan On 05/07/2012 12:30 PM, Karl Brand wrote: Dimitris, Petra, Thank you! aggregate() is my lesson for today, not melt() | cast() Really appreciate the super fast help, Karl

[R] wireframe and par(mfrow)

2012-05-07 Thread Simone Gabbriellini
Hello List, I have some plots with the wireframe() function, and I'd like to display them in a single jpeg file. I know that par(mfrow=c(x,y)) will divide my display window in x rows and y columns, and although this works with plot(), it looks like it's not working with wireframe. here's my code:

[R] Value of Hurst exponent (R/S) method > 1

2012-05-07 Thread Barun Saha
Hello, I'm using fArma package to estimate the value of Hurst exponent using R/S method. However, for a certain set of data I get H ~ 1.8. How do I interpret this? Following are the output that I get for this set: > mean(data[,2]) [1] 400.5433 > sd(data[,2]) [1] 1139.786 > > rsFit(data[,2], leve

  1   2   >