Re: [R] PCA analysis and bootstraped loadings

2015-04-13 Thread William Revelle
psych does not currently have bootstrapped confidence intervals for loadings. That is a reasonable request and I will try to add it, perhaps in the “real soon now” version of 1.5.4 (almost finished), perhaps in the next release, Bill > On Apr 13, 2015, at 2:38 PM, stephen sefick wrote: > > H

[R] calculate Cy0 with qpcR package when fitting is failed

2015-04-13 Thread Luigi Marongiu
Dear all, i am trying to calculate the Cy0 from a series of PCR runs in the 384-well. I can create the regression model using the modlist function: ml<-modlist( obj, cyc = 1, model = l4, norm = "FALSE", remove = "none" ) where obj is the dataframe with the fluo

Re: [R] Convert color hex code to color names

2015-04-13 Thread Jim Lemon
Hi Alejo, The color.id function in plotrix will do this, one color at a time: sapply(rainbow(6),color.id) #FFFF #00FF #00FF00FF #00FF # #FF00 [1,] "red" "yellow" "green" "cyan""blue""magenta" [2,] "red1""yellow1" "green1" "cyan1" "blue1" "magent

Re: [R] BIG difficulties in Using boot.ci (bot package)

2015-04-13 Thread Nordlund, Dan (DSHS/RDA)
That is probably the number one reason for requesting a reproducible example when writing to R-help. In the proce3ss of working that out, you often solve your own problem. Best of luck with your bootstrapping, Dan Daniel J. Nordlund, PhD Research and Data Analysis Division Services & Enterpris

[R] metafor - Cochrane on change score in pre-post design

2015-04-13 Thread Antonello Preti
Hi, this is another quesite related to the use of 'metafor' for calculation of standardized mean change in pre-post design studies. Essentially, my aim is to compare different method to arrive at the same conclusion: Does the treatment work? The Cochrane manual advise not to calculate change score

Re: [R] PCA analysis and bootstraped loadings

2015-04-13 Thread stephen sefick
Hi, Please search the mailing list archives for this, or type bootstrapped PCA R into google. Please provide a minimal self-contained example of what you are trying to solve. Please read the posting guide that is referenced at the end of every email. kind regards, Stephen On Mon, Apr 13, 2015 at

[R] 'metafor' - standardized mean difference in pre-post design studies

2015-04-13 Thread Antonello Preti
Hi, I have a quesite on meta-analysis with 'metafor'. I would like to calculate the standardized mean difference (SMD), as Hedges' g, in pre-post design studies. I have data on baseline (sample size, mean and SD in both the experimental and the control group) and at end of treatment (same as before

Re: [R] question

2015-04-13 Thread Boris Steipe
That all sounds so straightforward I wonder why you don't just code it up and try it out. You might profit from the advice of chapter 2 of the R-Inferno for your "main problem". If "some people" who you ask for advice think that arrays in R are intrinsically slow, you might also want to look fo

[R] question

2015-04-13 Thread Mahdiyeh Erfaniyan
Hi all, Recently I sent an email and I was asked to provide reproducible code of a simple example of my situation. Instead of providing the code, I decided to describe what I need in my code. I've written a function V, which is a function of (r,s); so I have a function V(r,s) in fact. The output of

Re: [R] BIG difficulties in Using boot.ci (bot package)

2015-04-13 Thread varin sacha
Hi Daniel, Sorry for that, once more ;=( Here is the reproducible code and this time IT WORKS FINALLY !!! GDP.LOG <-c(14,12,13,15.5,16,17,16.5,13.5,12.5,12) Quality.score <-c(12,11,13,14,15,16,12,10,9,9) Competitivness.score=c(8,6,7,5,6.5,7,8,4.5,6,7) df=data.frame(GDP.LOG,Quality.score,

Re: [R] Convert color hex code to color names

2015-04-13 Thread David L Carlson
Actually all 6 colors in rainbow(6) do have names. I missed the fact that rainbow() adds an alpha value that we need to strip off before comparing to the values in clrs$RGB: > rain <- substr(rain, 1, 7) > sum(clrs$RGB %in% rain) [1] 12 So there are two color names for each color in rainbow(6):

Re: [R] BIG difficulties in Using boot.ci (bot package)

2015-04-13 Thread Daniel Nordlund
On 4/13/2015 9:06 AM, varin sacha wrote: Hi Michael, Thanks for your response. About the data frame not necessary. I correct the code according to your comments. I still get the following warnings : [1] "All values of t are equal to 5.75620151906917 \n Cannot calculate confidence intervals" N

Re: [R] friedman.test error: not an unreplicated complete block design

2015-04-13 Thread lindsay hanford
Hi Peter, I thought it was possible to have multiple subjects in each group, while still specifying another factor, as is the case for repeated measures ANOVA. If this is not the case, I guess I should look into Regression models for count data as suggested by Micheal. On Mon, Apr 13, 2015 at 1:

Re: [R] Convert color hex code to color names

2015-04-13 Thread Martin Maechler
> To add slightly to that: > What you want to do is write a function that returns the named color that has > the smallest difference to your input hex-triplet. But note that color > difference is a large topic. Assuming you want to minimize *perceptual* > differences, you want to calculate your

Re: [R] friedman.test error: not an unreplicated complete block design

2015-04-13 Thread peter dalgaard
By coincidence, there actually _is_ enough info to pinpoint the issue: *Subj Group Emotion Response*94HRHappy 2 119 HC Happy 0 3 HR Sad 4 61 HC Sad 2 64 HC Sad 0 etc An unreplicated complete block design has exactly 1 observation for each combination of the

Re: [R] Convert color hex code to color names

2015-04-13 Thread David L Carlson
And expanding at a more elementary level. The reason you need to find the smallest difference is that all of the possible colors do not have names. There are 256^3 = 16,777,216 possible rgb color designations, but only 657 named colors. You can create a data frame of the named colors and their

Re: [R] friedman.test error: not an unreplicated complete block design

2015-04-13 Thread Michael Dewey
Dear Lindsay If the problem is that you have an excess of zeroes you might look at the vignette for the package pscl which is called something like Regression models for count data. On 13/04/2015 17:17, lindsay hanford wrote: Hello R Community, I am using the friedman.test() function to test

Re: [R] Convert color hex code to color names

2015-04-13 Thread Boris Steipe
To add slightly to that: What you want to do is write a function that returns the named color that has the smallest difference to your input hex-triplet. But note that color difference is a large topic. Assuming you want to minimize *perceptual* differences, you want to calculate your differenc

[R] PCA analysis and bootstraped loadings

2015-04-13 Thread Efstathia Defteraiou
Dear All, I am relatively new in R. Im working with the 'psych' package and 'principal' function. I would like to know how to generate the bootstraped conf.intervals for loadings, looking for sth similar to setting 'n.iter' argument for the 'fa' function. If in 'psych' can't work and suggest

Re: [R] friedman.test error: not an unreplicated complete block design

2015-04-13 Thread John Kane
We really need " commented, minimal, self-contained, reproducible code' as asked for in the note at the end of each R-help message. Have a look at http://adv-r.had.co.nz/Reproducibility.html and/or http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for some h

[R] friedman.test error: not an unreplicated complete block design

2015-04-13 Thread lindsay hanford
Hello R Community, I am using the friedman.test() function to test differences in a non-normally distributed dataset, with a dependent variable that either a continuous variable or a ratio and has 2+ groups. I am using the friedman.test instead of a repeated measures ANOVA because my dataset viol

Re: [R] BIG difficulties in Using boot.ci (bot package)

2015-04-13 Thread varin sacha
Hi Michael, Thanks for your response. About the data frame not necessary. I correct the code according to your comments. I still get the following warnings : [1] "All values of t are equal to 5.75620151906917 \n Cannot calculate confidence intervals" NULL I have found this on the Net : "Note

[R] Revolutions blog: March 2015 roundup

2015-04-13 Thread David Smith
Since 2008, Revolution Analytics staff and guests have written about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. (By the way, Revolution Analytics is

Re: [R] Convert color hex code to color names

2015-04-13 Thread Thierry Onkelinx
A combination of rgb(), col2rgb() and colors() can gives hex values for the named colors. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Be

Re: [R] R (3.1.2) sub-setting code related to "NA" on Windows not working!

2015-04-13 Thread John Kane
Below is what your code looked like in R-helpl. I looked at it for about 5 seconds and said, "If the poster cannot understand something as simple as "DO NOT post in HTML" it's not worth my time to decypher the mess. You are lucky Peter is more tolerant. Please do not post in HTML. code

Re: [R] R (3.1.2) sub-setting code related to "NA" on Windows not working!

2015-04-13 Thread peter dalgaard
This is almost unreadable due to HTML posting (do read the posting guide!). However, it would seem that you somehow got your data converted to factors of which one level is NA. This may be surprising, but the difference is like that of > factor(c("NA", 18)) [1] NA 18 Levels: 18 NA > factor(c("

[R] Convert color hex code to color names

2015-04-13 Thread Alejo C.S.
Hi all, I want to convert the output of: > rainbow(6) > [1] "#FFFF" "#00FF" "#00FF00FF" "#00FF" "#" "#FF00" To a vector of color names. Any tip? Thanks in advance C. [[alternative HTML version deleted]] __ R-help@r-

Re: [R] mutiple data sets

2015-04-13 Thread Boris Steipe
Jean gave you an excellent pointer for your original question. To continue - - break down your task into small steps - implement your steps piece by piece - actually read (and follow) the posting guide for this list (http://www.R-project.org/posting-guide.html) - see here for some additional hin

Re: [R] BIG difficulties in Using boot.ci (bot package)

2015-04-13 Thread Michael Dewey
See in line On 13/04/2015 14:38, varin sacha wrote: Hi Jean, Many thanks, I got it but there is still a problem. When trying to bootstrap the confidence intervals, I get these messages. boot.ci(results,type="bca",index=1) [1] "All values of t are equal to 5.75620151906917 \n Cannot calculat

[R] R (3.1.2) sub-setting code related to "NA" on Windows not working!

2015-04-13 Thread Sarada Samantaray
My AirQuality[4,1] is equal to 18 and AirQuality[5,1] is equal to NA. When I type the following > is.na(AirQuality[5,1])[1] FALSE> AirQuality[5,1][1] NA68 Levels: 1 10 108 11 > 110 115 118 12 122 13 135 ... NA> is.na(AirQuality[4,1])[1] FALSE> > AirQuality[4,1][1] 1868 Levels: 1 10 108 11 110 115

Re: [R] mutiple data sets

2015-04-13 Thread Adams, Jean
You should cc r-help in your reply to keep everyone in the loop. Jean On Mon, Apr 13, 2015 at 8:02 AM, rsm wrote: > Hi Jean > Truly appreciate your guidance. > honestly, finding it bit challenging to plot. > before plotting. > i have some basic q. > have multiple data sets spanning over 15 yea

Re: [R] mutiple data sets

2015-04-13 Thread rsm
Hi Truly appreciate your guidance. honestly, finding it bit challenging to plot. before plotting. i have some basic q. have multiple data sets spanning over 15 years of One Y , the Independent, X about 30 dependent variables. am trying to build a forecasting program for Y , given changes in X. a

Re: [R] BIG difficulties in Using boot.ci (bot package)

2015-04-13 Thread varin sacha
Hi Jean, Many thanks, I got it but there is still a problem. When trying to bootstrap the confidence intervals, I get these messages. boot.ci(results,type="bca",index=1) [1] "All values of t are equal to 5.75620151906917 \n Cannot calculate confidence intervals" NULL > boot.ci(results,type

Re: [R] mutiple data sets

2015-04-13 Thread Adams, Jean
There are some examples of how to plot correlation matrices at this link. http://stackoverflow.com/questions/5453336/plot-correlation-matrix-into-a-graph/26637268#26637268 Perhaps that will help get you started. Jean On Mon, Apr 13, 2015 at 5:11 AM, ravimantha wrote: > Hi just started in R, t

Re: [R] operations on columns when data frames are in a list

2015-04-13 Thread Adams, Jean
If you write a function that takes a data frame as an argument and returns a data frame, you can use lapply to carry out the tasks that you want. For example, if your list of data frames is called mydat ... mon2date <- function(df) { if ("Month" %in% names(df)) { df$Month<- as.POSIXct(df$Mo

Re: [R] problem in replication

2015-04-13 Thread Adams, Jean
Why did you submit this post? Are you asking for help with something? Reporting an update on an earlier post? Jean On Mon, Apr 13, 2015 at 5:43 AM, thanoon younis wrote: > Hi > I have a small problem with my code in R. The problem is the replication of > simulation didn't work as a sequence fro

[R] mutiple data sets

2015-04-13 Thread ravimantha
Hi just started in R, this is the first time. I have one Y & Multiple X variables. was trying to do Correlation, managed it using cov( Y,X) unable to plot the above. further since the data sets is very large of about 20 years * 30 variables, end objective is to build a forecasting model Y. have

[R] operations on columns when data frames are in a list

2015-04-13 Thread Steve E.
Hello R folks, I have recently discovered the power of working with multiple data frames in lists. However, I am having trouble understanding how to perform operations on individual columns of data frames in the list. For example, I have a water quality data set (sample data included below) that c

Re: [R] How to complete this code

2015-04-13 Thread Adams, Jean
You will likely get more help answering your question if you provide reproducible code of a simple example of your situation. Jean On Fri, Apr 10, 2015 at 3:42 PM, Mahdiyeh Erfaniyan < mahdiyeh.erfani...@gmail.com> wrote: > Hi, > > > Consider the line below: > > > > for(r in a)for (s in a) x=rbi

Re: [R] BIG difficulties in Using boot.ci (bot package)

2015-04-13 Thread Adams, Jean
S, There is no mention of a type="bca" argument on the ?confint help file. You can look here for an example of using the boot.ci() function in the boot package: http://www.statmethods.net/advstats/bootstrapping.html ​Jean​ On Fri, Apr 10, 2015 at 11:01 AM, varin sacha wrote: > Dear R-Expert

[R] problem in replication

2015-04-13 Thread thanoon younis
Hi I have a small problem with my code in R. The problem is the replication of simulation didn't work as a sequence from r=1 to 100 but the results stop at 1 and when i close the first results with r=1 the second results run and so on. i want to leave my computer to run until finish 100 replication

Re: [R] Finding which seed resulted in a specific sample

2015-04-13 Thread Prof Brian Ripley
On 13/04/2015 10:12, Isabel Natario wrote: Hello! I was wanting to find out which random seed could generate the characters in the word "love", for example, when I sample with replacement from the vector of the letters. So I've written the code below: seed=0 set.seed=0 x<-sample(letters,4,repla

Re: [R] Finding which seed resulted in a specific sample

2015-04-13 Thread Thierry Onkelinx
you need set.seed(seed) instead of set.seed = seed ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician afte

Re: [R] Obfuscate AES password

2015-04-13 Thread Luca Cerone
Thanks Jeff, and OK I'll move next questions on the topic to the devel list :) I was hoping there were packages that already dealt with this sort of things, that's why I posted my question here in the first place.. Thanks a lot for helping me with this, Cheers, Luca [[alternative HTML v

[R] Finding which seed resulted in a specific sample

2015-04-13 Thread Isabel Natario
Hello! I was wanting to find out which random seed could generate the characters in the word "love", for example, when I sample with replacement from the vector of the letters. So I've written the code below: seed=0 set.seed=0 x<-sample(letters,4,replace=T) while (sum(x==c("l","o","v","e"))<4){ s

Re: [R] Finding values in a dataframe at a specified hour

2015-04-13 Thread PIKAL Petr
Hi I presume your data frames are not big. What about merging them by hour and comparing appropriate columns? something like windMerged<-merge(windHW, spring, by = "hour", all=TRUE) sel <- which(windMerged[, xx] >= windMerged[,yy]) windMerged[sel, xx] <- NA Untested because lack of data. Chee

[R] plm returning less number of variable than provided as input

2015-04-13 Thread Anindya Sankar Dey
Hi, I was trying a plm model with around 400 variables, but after passing that to the plm function I am getting coefficients for 265 variables. Can anyone explain me the reason? Is there a size restriction in plm? -- Anindya Sankar Dey [[alternative HTML version deleted]] __