[R] Ridge regression

2013-04-30 Thread Preetam Pal
Hi all, I have run a ridge regression on a data set 'final' as follows: reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$u, lambda=seq(0,10,0.01)) Then I enter : select(reg) and it returns: modified HKB estimator is 19.3409 modified L-W

[R] Error message after R-3.0.0 upgrade installation

2013-04-30 Thread Anupam Tyagi
R-3.0.0 prints an error message at startup. I uninstalled a previous version and installed this on Windows 8. Uninstall of previous version deleted all previously installed packages and I forgot to keep a list of them. How do I correct this error? Error: requested primitive type is not

Re: [R] Error message after R-3.0.0 upgrade installation

2013-04-30 Thread Prof Brian Ripley
On 30/04/2013 07:44, Anupam Tyagi wrote: R-3.0.0 prints an error message at startup. I uninstalled a previous version and installed this on Windows 8. Uninstall of previous version deleted all previously installed packages and I forgot to keep a list of them. How do I correct this error?

Re: [R] rbinding some elements from a list and obtain another list

2013-04-30 Thread De Castro Pascual, Montserrat
BINGO!!! Many thanks arun! You are a genious!!! montserrat -Mensaje original- De: arun [mailto:smartpink...@yahoo.com] Enviado el: lunes, 29 de abril de 2013 18:33 Para: De Castro Pascual, Montserrat CC: R help Asunto: Re: [R] rbinding some elements from a list and obtain another list

Re: [R] rbinding some elements from a list and obtain another list

2013-04-30 Thread De Castro Pascual, Montserrat
Wow! It's true!!! Many thanks!!! montserrat -Mensaje original- De: MacQueen, Don [mailto:macque...@llnl.gov] Enviado el: lunes, 29 de abril de 2013 22:39 Para: De Castro Pascual, Montserrat; r-help@r-project.org Asunto: Re: [R] rbinding some elements from a list and obtain another list

[R] Mixed Modeling in lme4

2013-04-30 Thread Indrajit Sengupta
Hi All, I am trying to shift from running mixed models in SAS using PROC MIXED to using lme4 package in R. In trying to match the coefficients of R output to that of SAS output, I came across this problem. The dataset I am using is this one:

Re: [R] rbinding some elements from a list and obtain another list

2013-04-30 Thread De Castro Pascual, Montserrat
Hi David, Sorry if I have explain me wrong! Mylist-list(A=data.frame, B=data.frame, C=data.frame, D=data.frame) I know that this is a malformed command, only was a fast way to descrive mylist. Thank you! -Mensaje original- De: David Winsemius [mailto:dwinsem...@comcast.net] Enviado el:

Re: [R] Mixed Modeling in lme4

2013-04-30 Thread Joshua Wiley
Hi Indrajit, In your first SAS code, change to type=un. cs imposes the (somewhat dubious) assumption that the variance of both the intercept and slope are equal. If you are using lme4, all random effects in a single block (e.g., (1 + month | batch) the 1 = intercept and month = random slope)

[R] ADF test --time series

2013-04-30 Thread Preetam Pal
Hi all, I was running the adf test in R. CODE 1: adf.test(data$LOSS) Augmented Dickey-Fuller Test data: data$LOSS Dickey-Fuller = -1.9864, Lag order = 2, p-value = 0.5775 alternative hypothesis: stationary CODE 2: adf.test(diff(diff(data$LOSS))) Augmented Dickey-Fuller

Re: [R] Mixed Modeling in lme4

2013-04-30 Thread Indrajit Sengupta
Thanks a lot Joshua. Regards, Indrajit On Tue, Apr 30, 2013 at 1:13 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: Hi Indrajit, In your first SAS code, change to type=un. cs imposes the (somewhat dubious) assumption that the variance of both the intercept and slope are equal. If you are

[R] Extrafont package: Fonts are not successfully installed

2013-04-30 Thread jpm miao
Hi, I am using Extrafont package to install more fonts for my graphs. My primary graphic tool is ggplot2. I seem to have problem installing the package, but could not pinpoint where it is. I try to follow the instruction here: https://github.com/wch/extrafont I guess (but am not sure)

[R] task percentage completion

2013-04-30 Thread Fabio Berzaghi
Dear All, Is it possible to add a percentage completion bar to R? I find it frustrating when running long calculations that I don't know at what point the process is. It would be very helpful so I am not guessing if I should wait a few minutes or hours.

Re: [R] task percentage completion

2013-04-30 Thread Prof Brian Ripley
On 30/04/2013 10:40, Fabio Berzaghi wrote: Dear All, Is it possible to add a percentage completion bar to R? I find it frustrating when running long calculations that I don't know at what point the process is. It would be very helpful so I am not guessing if I should wait a few minutes or

Re: [R] task percentage completion

2013-04-30 Thread R. Michael Weylandt
On Tue, Apr 30, 2013 at 10:40 AM, Fabio Berzaghi f...@dmu.dk wrote: Dear All, Is it possible to add a percentage completion bar to R? I find it frustrating when running long calculations that I don't know at what point the process is. It would be very helpful so I am not guessing if I should

Re: [R] R Function to extract columnNames

2013-04-30 Thread arun
Hi, May be this helps: funcName- function(df1, x){  whatCol=df1[[x]]  print(Got it)  print(whatCol)  }   funcName(df,ColA) #[1] Got it #[1] 1 2 3 4 5   funcName(df,ColB) #[1] Got it #[1] A B C D E #Levels: A B C D E A.K. I am trying to extract the 2nd column from a dataframe using a function

Re: [R] ADF test --time series

2013-04-30 Thread Jeff Newmiller
a) This looks like homework. The Posting Guide clearly indicates that this list is not for homework help. b) This is a statistics theory question that happens to use R, not an R question that happens to be about statistics. Also off-topic per the Posting Guide... there are other forums for

Re: [R] how to add new rows in a dataframe?

2013-04-30 Thread arun
Hi, Not sure if this is what you meant. dat1- read.table(text= id    t scores  scores2  scores3 2 0    1.2 1.4    1.9 2 2 2.3 2.5   2.2 2 3    3.6 

Re: [R] bigmemory and R 3.0

2013-04-30 Thread Benjamin Caldwell
Thanks to you all for your replies. I didn't realize bigmemory is only available in Unix environments - when I saw install.packages('bigmemory') Installing package into ‘C:/Users/BenC/Documents/R/win-library/3.0’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session

Re: [R] R help - bootstrap with survival analysis

2013-04-30 Thread Terry Therneau
This comes up regularly. Type ?print.survfit and look at the comments there under value. Terry T. - begin included message Hi, I'm not sure if this is the proper way to ask questions, sorry if not. But here's my problem: I'm trying to do a bootstrap estimate of the

Re: [R] biplot for principal componens analysis

2013-04-30 Thread capricy gao
very helpful!! Thanks a lot. From: Jim Lemon j...@bitwrit.com.au Cc: r-help@r-project.org r-help@r-project.org Sent: Monday, April 29, 2013 6:53 PM Subject: Re: [R] biplot for principal componens analysis On 04/30/2013 08:24 AM, capricy gao wrote: I

Re: [R] Comparing two different 'survival' events for the same subject using survdiff?

2013-04-30 Thread Terry Therneau
-Original Message- I have a dataset which for the sake of simplicity has two endpoints. We would like to test if two different end-points have the same eventual meaning. To try and take an example that people might understand better: Lets assume we had a group of subjects who all

[R] Error message

2013-04-30 Thread Havenga, BS, Mnr 15264...@sun.ac.za
Hi there I am a Masters student at the University of Stellenbosch. I have been using R to analyze the data, using the GLS model, of one of my experiments. The problem that I am having is that whenever I run my model using:

[R] Cox model: random effect on a variable with 3 levels

2013-04-30 Thread lmajed
Question about package Coxme: I develop a cox model that includes a variable treatment with 3 levels (A, B, C): model_alea_int - coxme(Surv(delai, status) ~ (1|trt)+ strata(center) , data) I am surprised that the output given in R is 3 coefficients for random effects whereas only 2 dummy

[R] Fastbw() function: grouping of variables

2013-04-30 Thread Mourik-2, M.S.M. van
Dear R users, For the purpose of validating a prediction model using validate() from the rms package, I am running into some trouble with using the fastbw() function breaking up natural groups of variables. Is there any way I can specify to keep certain variable together? In particular, if

[R] Stacked geom_bar with aggregated SE -ggplot2

2013-04-30 Thread Olivia Burge
Hi there,  I've been battling with an extension of this in my own data: getting appropriate error bars once data is stacked in a bar graph.  (original question: http://r.789695.n4.nabble.com/ggplot2-se-variable-in-geom-errorbar-s-limits- td3311176.html). It wouldn't let me reply to that thread.

[R] vegan -varpart is bigger than 100% in total?

2013-04-30 Thread Ozgul Inceoglu
I am trying to find the percentage of the parameters explaining the bacterial community composition. I have one data matrix with relative abundance of OTUs and one with environmental parameters. I used varpart in vegan package but the values in the venn diagram is bigger than 100% in total.How

[R] Panel Granger Causality Tests

2013-04-30 Thread londonphd
Hi, I was wondering if there is a package/function for Panel Granger non-causality tests? I am interested in Toda-Yamamoto procedure in panel data setting. Thank you, -- View this message in context: http://r.789695.n4.nabble.com/Panel-Granger-Causality-Tests-tp4665834.html Sent from the R

Re: [R] R Function to extract columnNames

2013-04-30 Thread David Winsemius
On Apr 30, 2013, at 6:00 AM, arun wrote: Hi, May be this helps: funcName- function(df1, x){ whatCol=df1[[x]] print(Got it) print(whatCol) } funcName(df,ColA) #[1] Got it #[1] 1 2 3 4 5 funcName(df,ColB) #[1] Got it #[1] A B C D E #Levels: A B C D E To ST; You should

[R] How to handle errors generated by the package Kendall?

2013-04-30 Thread Kaptue Tchuente, Armel
Hello everyone, I'm trying to perform some trend analysis using the package Kendall and for some observations I get the following error WARNING Error exit, tauk2, IFAULT = 12 Could anyone tell me how to create a logical vector of observations having its element equal to TRUE if this error

Re: [R] Error message

2013-04-30 Thread Jeff Newmiller
That is unlikely in the absence of a reproducible example [1]. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example --- Jeff NewmillerThe . . Go

Re: [R] Stacked geom_bar with aggregated SE -ggplot2

2013-04-30 Thread John Kane
Hi Olvia, Welcome to the R-help list. Are you seriously proposing to add error bars to a stacked barplot? Why? Do you mean a dodged barplot? My first thought is that there probably are several better ways of presenting your data than stacked bar charts--I sometimes think that anything other

[R] still about biplot for principal componens analysis

2013-04-30 Thread capricy gao
I noticed that the points on the biplot are not exactly the same as the predicted values. Could any body give me a  hint about why? Thanks. To: Jim Lemon j...@bitwrit.com.au Cc: r-help@r-project.org r-help@r-project.org Sent: Tuesday, April 30, 2013 9:51

[R] Grouped spaghetti plots in multipanel graphs

2013-04-30 Thread Santosh
Dear Rxperts, Is there a simpler way to generate multipanel grouped individual profile plots? All individuals of a group within a panel have the same color. As of now I am using lattice::xyplot to get the desired effect. Please feel free to suggest other ideas. Also, I am trying to create a

[R] Trouble with reading xml in R

2013-04-30 Thread Dorte Klerke
Hi I have been trying for days now to read the contents of this xml file into R. I tried the simpler solution xmlToDataFrame, which worked on another file, but somehow it doesn't work for this file. I have tried different other solutions, but I just can't seem to get it quite right. doc -

Re: [R] Error message

2013-04-30 Thread Bert Gunter
Actually, Jeff, it may not be. The OP has likely overfit -- as a guess, Depth is essentially continuous and as.factor() produces too many levels. I would recommend that the OP find a local statistical consultant to help him, as he seems out of his depth, statistically. Failing that, he should

Re: [R] Error message

2013-04-30 Thread Bert Gunter
Another alternative might be to post the the r-sig-mixed-models list gls() is part of nlme. -- Bert On Tue, Apr 30, 2013 at 11:12 AM, Bert Gunter bgun...@gene.com wrote: Actually, Jeff, it may not be. The OP has likely overfit -- as a guess, Depth is essentially continuous and as.factor()

[R] Quote as element of a vector/list

2013-04-30 Thread Jie
Dear All, I would like to store quote as part of an vector. For instance, I would like to get an character object as x = 12ab34 or y = c(1, 2, , a, b, , 3, 4) Is that possible? Thank you. Best wishes, Jie [[alternative HTML version deleted]]

Re: [R] Quote as element of a vector/list

2013-04-30 Thread arun
 y = c(1, 2, '', a, b, '', 3, 4)  y #[1] 1  2  \ a  b  \ 3  4 A.K. - Original Message - From: Jie jimmycl...@gmail.com To: r-help@r-project.org r-help@r-project.org Cc: Sent: Tuesday, April 30, 2013 2:46 PM Subject: [R] Quote as element of a vector/list Dear All, I would like

Re: [R] select and do some calculations/manipulations on certain rows based on conditions in R

2013-04-30 Thread arun
Hi, Try this: dat1-read.table(text=     ID X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 1   5184    0    0    1    0    0   0   0    0    0    1 0  0  0   0  0  0 2   6884    0    0    1    0    0   1   0    0    0    0 0  0  0   0  0 

Re: [R] Quote as element of a vector/list

2013-04-30 Thread Peter Alspach
Tena koe Jie Try x - ' 12ab34 ' plot(1:10, xlab=x) HTH ... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jie Sent: Wednesday, 1 May 2013 6:46 a.m. To: r-help@r-project.org Subject: [R] Quote as element of a

[R] Line similarity

2013-04-30 Thread Satsangi, Vivek (GE Capital)
Folks, This is probably a help me google this properly, please-type of question. In TIBCO Spotfire, there is a procedure called line similarity. I use this to determine which observations show a growing, stable or declining pattern... sort of like a

Re: [R] Line similarity

2013-04-30 Thread William Dunlap
Here is one way to, for each row in the data.frame v, regress the numbers in columns 2 through 4 on the numbers 1 through 3, storing only the slopes, and then creating a column saying if the slope is greater than zero or not. v[,Beta] - vapply(seq_len(nrow(v)),

Re: [R] Line similarity

2013-04-30 Thread Bert Gunter
1. Read an Introduction to R or other R tutorial to learn how R works. 2. You apparently wish to apply a function, f, to each row of a data frame or matrix to classify it as growing, declining, etc. Only you know what that function should look like. Write it. 3. Apply it using ?apply or perhaps

Re: [R] Line similarity

2013-04-30 Thread arun
Hi, You could also do: v- read.table(text= Name Year_1_value Year_2_value Year_3_value A 1 2 3 B 2 7 19 C 3 4 2 D 10 7 6 E 4 4 5 F NA 3 6 ,sep=,header=TRUE,stringsAsFactors=FALSE) names(v)[-1]-gsub((.*\\d+)_.*$,\\1,names(v)[-1]) v2- v v1-reshape(v,direction=long,varying=2:4,sep=_)

Re: [R] still about biplot for principal componens analysis

2013-04-30 Thread capricy gao
Looks like my post might get some problems, so I re-wrote my question plus some new one... I noticed that the points on the biplot are not exactly the same as the predicted values. Another relevant question: should I expect that all the vector points have the same length if  chose

Re: [R] Trouble with reading xml in R

2013-04-30 Thread Barry Rowlingson
On Tue, Apr 30, 2013 at 5:12 PM, Dorte Klerke dkle...@hotmail.com wrote: Hi I have been trying for days now to read the contents of this xml file into R. I tried the simpler solution xmlToDataFrame, which worked on another file, but somehow it doesn't work for this file. How is this

[R] help understanding hierarchical clustering

2013-04-30 Thread epi
Hi All, i've problem to understand how to work with R to generate a hierarchical clustering my data are in a csv and looks like : idcode,count,temp,sal,depth_m,subs 16001,136,4.308,32.828,63.46,47 16001,109,4.31,32.829,63.09,49 16001,107,4.302,32.822,62.54,47 16001,87,4.318,32.834,62.54,48

[R] significantly different from one (not zero) using lm

2013-04-30 Thread Elaine Kuo
Hello, I am work with a linear regression model: y=ax+b with the function of lm. y= observed migration distance of butterflies x= predicted migration distance of butterflies Usually the result will show if the linear term a is significantly different from zero based on the p-value. Now

[R] Trouble with methods() after loading gdata package.

2013-04-30 Thread Paul Johnson
Greetings to r-help land. I've run into some program crashes and I've traced them back to methods() behavior after the package gdata is loaded. I provide now a minimal re-producible example. This seems bugish to me. How about you? dat - data.frame(x = rnorm(100), y = rnorm(100)) lm1 - lm(y ~ x,

Re: [R] significantly different from one (not zero) using lm

2013-04-30 Thread Paul Johnson
It is easy to construct your own test. I test against null of 0 first so I can be sure I match the right result from summary.lm. ## get the standard error seofb - sqrt(diag(vcov(lm1))) ## calculate t. Replace 0 by your null myt - (coef(lm1) - 0)/seofb mypval - 2*pt(abs(myt), lower.tail = FALSE,

Re: [R] significantly different from one (not zero) using lm

2013-04-30 Thread Thomas Lumley
Or use an offset lm( y ~ x+offset(x), data = dat) The offset gives x a coefficient of 1, so the coefficient of x in this model is the difference between the coefficient of x in the model without an offset and 1 -- the thing you want. -thomas On Wed, May 1, 2013 at 2:54 PM, Paul Johnson