[R] normalité test using over identifying moment conditions

2013-02-01 Thread Usman Gilani
Hi, I'm trying to interpret the following results, with respect to normality test using the over identifying moment conditions where returns have normal distribution with parameter mu,sd and i have 4 moment conditions E[r-mu/sd]=0 E[(r-mu)^2/sd-1]=0 E[(r-mu)^3/sd^3]=0 E[(r-mu)^4/sd^4-3]=0

[R] ks.test and wilcoxon.test results differ from other stat.packages

2013-02-01 Thread Alexander Favorov
Probably, it's an obvious info, but I have not found anything in R FAQ concerning this feature/bug. The results of ks.test and wilcoxon.test (in the Mann-Whitney version, paired = 'FALSE') don't coincide with the results from the other statistical packages, e.g. Statistica, Medcalc, and (as for

[R] difftime() out by 1 hour

2013-02-01 Thread Boots
I have a problem with results from difftime being 1 hour different than expected. 2 examples are given below: datetime - matrix(data=rbind(c(2012-03-31 21:00:00, 2012-04-01 00:00:00, 2012-04-01 03:00:00, 2012-04-01 06:00:00), c(2012-10-06 21:00:00, 2012-10-07 00:00:00,

[R] Filter according to the latest data

2013-02-01 Thread Mat
Hello together, i have a data.frame, like this one: No. Change Date A 123 final2013-01-15 B 123 error 2013-01-16 C 123 bug fixed 2013-01-17 D

Re: [R] difftime() out by 1 hour

2013-02-01 Thread Pascal Oettli
Hello, Here is the result I get using your script: sessionInfo() R version 2.15.2 (2012-10-26) Platform: x86_64-suse-linux-gnu (64-bit) [1] 2012-03-31 21:00:00 2012-04-01 00:00:00 2012-04-01 03:00:00 [4] 2012-04-01 06:00:00 Time differences in hours [1] 3 3 3 attr(,tzone) [1] [1] 2012-10-06

Re: [R] use name (not values!) of a dataframe inside a funktion

2013-02-01 Thread PIKAL Petr
Hi Maybe others can help you but here is my comment. I already use R for many years and never used such construction. Objects in global environment shall not be modified by functions it is a bad practice. Imagine you have some data frame you prepared and controlled in many steps and use some

Re: [R] Transforming 4x3 data frame into 2 column df in R

2013-02-01 Thread Jorge I Velez
Dear Gundala, Try as.data.frame.table(foo) HTH, Jorge.- On Fri, Feb 1, 2013 at 5:00 PM, Gundala Viswanath wrote: I have the following data frame: foo w x y z n 1.51550092 1.4337572 1.2791624 1.1771230 q 0.09977303 0.8173761 1.6123402 0.1510737 r

Re: [R] facet plot

2013-02-01 Thread Dennis Murphy
Hi: Try DF - structure(list(Gene = structure(1:5, .Label = c(NM_001001130, NM_001001144, NM_001001152, NM_001001160, NM_001001176 ), class = factor), T0h = c(68L, 0L, 79L, 1L, 0L), T0.25h = c(95L, 1L, 129L, 1L, 0L), T0.5h = c(56L, 4L, 52L, 2L, 0L), T1h = c(43L, 0L, 50L, 0L, 0L), T2h = c(66L, 1L,

Re: [R] Nested loop and output help

2013-02-01 Thread PIKAL Petr
Hi see inline -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of staysafe23 Sent: Friday, February 01, 2013 1:01 AM To: r-help@r-project.org Subject: [R] Nested loop and output help Hello Everyone, My name is Thomas and I

Re: [R] difftime() out by 1 hour

2013-02-01 Thread PIKAL Petr
Hi The same with me on Windows Most probably an issue of daylight savings time setting. Sys.timezone() [1] CET Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Pascal Oettli Sent: Friday, February 01, 2013 9:18

[R] Cumulative Incidence Function and Pseudovalue

2013-02-01 Thread Tasnuva Tabassum
Hi, I want to write own R functions for cumulative incidence function and also for the pseudovalue of the cumulative incidence function. Can you help me? Tas. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Was confused with options(error = expression(NULL)) in example(stop)

2013-02-01 Thread Suharto Anggono Suharto Anggono
In example for function 'stop' in R, there is options(error = expression(NULL)) with comment # don't stop on stop(.) Use with CARE! I was interested, wanted to know how don't stop on stop(.) was. So, I tried it. Typing example(stop) at the R prompt and pressing ENTER give this.

Re: [R] Using eigen() for extracting only few major eigenpairs

2013-02-01 Thread Pierrick Bruneau
Thanks a lot, I'll test this package very soon. As it seems general purpose (ie not specifically fitted to the square symmetric context), I hope the advantage over the standard routine for symmetric matrices remains significant. Pierrick Bruneau CRP Gabriel Lippmann On Thursday, January 31,

[R] how to setdiff on lists of lists

2013-02-01 Thread Simone Gabbriellini
Dear List, I have a data structure like: aa [[1]] [1] 1 2 3 [[2]] [1] 4 5 6 bb [[1]] [1] 3 [[2]] [1] 5 I would like to set differences between aa and bb and get as result another list of lists like: res [[1]] [1] 1 2 [[2]] [1] 4 6 I am trying: lapply(aa, setdiff, bb) but I simply get

Re: [R] how to setdiff on lists of lists

2013-02-01 Thread PIKAL Petr
Hi you have something wrong in your R session, works for me. aa-list(c(1:3), c(4:6)) aa [[1]] [1] 1 2 3 [[2]] [1] 4 5 6 bb-list(3,5) bb [[1]] [1] 3 [[2]] [1] 5 lapply(aa, setdiff, bb) [[1]] [1] 1 2 [[2]] [1] 4 6 Regards Petr -Original Message- From:

Re: [R] ks.test and wilcoxon.test results differ from other stat.packages

2013-02-01 Thread Meyners, Michael
Impossible to say w/o a reproducible example, but to start with let me suggest looking at the exact= (both functions) and correct= (wilcox.test) arguments. Experience shows that some change of the default settings allows you to reproduce results from other software (and the help pages will

[R] how to

2013-02-01 Thread Simone Gabbriellini
Dear List, I have a list of lists and on each list I want to apply a function from the igraph package, graph.knn. I need to calculate graph.knn for each list on a graph g, then retrieve one of the result called $knn and calculate its mean. The non-R style code looks like this: for(i in

Re: [R] help on proportions

2013-02-01 Thread Ista Zahn
Hi Srini, This is a statistics question, not a question about R, so this may not be the best place to ask. Try posting at http://stats.stackexchange.com/ or another statistics help list. Best, Ista On Thu, Jan 31, 2013 at 11:11 PM, Srinivas Iyyer srini_iyyer_...@yahoo.com wrote: Hi: Apologies

Re: [R] Question on plotCI function

2013-02-01 Thread Ista Zahn
There are many plotCI functions in many different packages... which one are you referring to? Also please construct a reproducible example illustrating your problem. Best, Ista On Thu, Jan 31, 2013 at 11:58 PM, li li hannah@gmail.com wrote: Hi all, In my plotCI function, the argument x

Re: [R] how to

2013-02-01 Thread PIKAL Petr
Hi I do not see any problem with your code. *apply functions are also hidden cycles and there shall not be substantial improvement in speed. Why you do not want to use for cycle? Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On

Re: [R] Filter according to the latest data

2013-02-01 Thread jim holtman
try this: x - read.table(text = No. Change Date + A 123 final2013-01-15 + B 123 error 2013-01-16 + C 123 'bug fixed' 2013-01-17 + D 111

Re: [R] how to setdiff on lists of lists

2013-02-01 Thread jim holtman
You can also try 'mapply' aa-list(c(1:3), c(4:6)) bb-list(3,5) mapply(setdiff, aa, bb) [,1] [,2] [1,]14 [2,]26 On Fri, Feb 1, 2013 at 5:16 AM, Simone Gabbriellini simone.gabbriell...@gmail.com wrote: Dear List, I have a data structure like: aa [[1]] [1] 1 2 3

Re: [R] how to

2013-02-01 Thread Simone Gabbriellini
Hi, Yes I know it works, but I'd like to assign the results like this: V(g)$meanknn - ONELINER Where V(g) elencates all the nodes in my graph... Thanks, Simone Sent from my iPhone. Please excuse brevity and odd typos On 01/feb/2013, at 13:31, PIKAL Petr petr.pi...@precheza.cz wrote: Hi

[R] Converting Date to Unix Time

2013-02-01 Thread Lorenzo Isella
Dear All, I am struggling with a simple problem. I did some online research, but I am still banging my head against the floor. I read a csv file into a data frame and I have a columns with entries like 2012-04-13 00:23:45 2012-04-22 07:53:09 etc.. Each line posted above is the content of a

Re: [R] Transforming 4x3 data frame into 2 column df in R

2013-02-01 Thread nalluri pratap
newdf-data.frame(k1=rep(row.names(foo),ncol(foo)),stack(foo)) --- On Fri, 1/2/13, Gundala Viswanath gunda...@gmail.com wrote: From: Gundala Viswanath gunda...@gmail.com Subject: [R] Transforming 4x3 data frame into 2 column df in R To: r-h...@stat.math.ethz.ch r-h...@stat.math.ethz.ch Date:

[R] How does this function print, why is n1 which equals 1 printed as 2?

2013-02-01 Thread John Sorkin
Windows 7, R 2.12.1 Colleagues, I am trying to understand the n.for.2means function. The code below is a copy of the function (renamed to n.for.2means.js). I have inserted a single line of code towards the bottom of the function which uses the cat function to print the value of n1. You will

[R] expand.grid on contents of a list

2013-02-01 Thread Dimitri Liakhovitski
Hello! I have a list of variable length. One example is: X=vector(list,3) X[[1]]=1:2 X[[2]]=1:2 X[[3]]=1:2 How could I run expand.grid on the elements of X so that the results would be the same as expand.grid(1:2,1:2,1:2)? Thank you! Dimitri -- Dimitri Liakhovitski gfk.com

Re: [R] Converting Date to Unix Time

2013-02-01 Thread Hasan Diwan
Mr Isella, On 1 February 2013 05:37, Lorenzo Isella lorenzo.ise...@gmail.com wrote: How can I convert that into Unix time? format.POSIXct(dateCol, '%s'); -- H -- Sent from my mobile device Envoyait de mon portable __ R-help@r-project.org mailing

Re: [R] How does this function print, why is n1 which equals 1 printed as 2?

2013-02-01 Thread Duncan Murdoch
On 13-02-01 8:47 AM, John Sorkin wrote: Windows 7, R 2.12.1 Colleagues, I am trying to understand the n.for.2means function. The code below is a copy of the function (renamed to n.for.2means.js). I have inserted a single line of code towards the bottom of the function which uses the cat

Re: [R] how to

2013-02-01 Thread PIKAL Petr
Hi So why you do not assign it inside a cycle? As I said lapply does the same as for cycle does (maybe in some more compact manner). Regards Petr -Original Message- From: Simone Gabbriellini [mailto:simone.gabbriell...@gmail.com] Sent: Friday, February 01, 2013 2:29 PM To: PIKAL

Re: [R] expand.grid on contents of a list

2013-02-01 Thread Dimitri Liakhovitski
Oops, it was easier than I thought: expand.grid(X) Dimitri On Fri, Feb 1, 2013 at 8:48 AM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! I have a list of variable length. One example is: X=vector(list,3) X[[1]]=1:2 X[[2]]=1:2 X[[3]]=1:2 How could I run expand.grid on

Re: [R] How does this function print, why is n1 which equals 1 printed as 2?

2013-02-01 Thread David Winsemius
On Feb 1, 2013, at 7:47 AM, John Sorkin wrote: Windows 7, R 2.12.1 Colleagues, I am trying to understand the n.for.2means function. The code below is a copy of the function (renamed to n.for.2means.js). I have inserted a single line of code towards the bottom of the function which uses

Re: [R] help on proportions

2013-02-01 Thread James C. Whanger
Hello Srini, It sounds as if you are attempting to establish a prior probability and compare it to the posterior probability -- a perfect candidate for bayesian analysis. I would simply do a search for 'bayesian analysis of gene expression data' -- there are a number of statistical packages that

Re: [R] expand.grid on contents of a list

2013-02-01 Thread arun
Hi, expand.grid(X) # Var1 Var2 Var3 #1111 #2211 #3121 #4221 #5112 #6212 #7122 #8222 expand.grid(1:2,1:2,1:2) # Var1 Var2 Var3 #1111 #2211 #3121 #4

Re: [R] obtainl survival curves for single strata

2013-02-01 Thread Terry Therneau
Stephen, I can almost but not quite get my arms around what you are asking. A bit more detail would help. Like cph.approve = what kind of object, generated by function __ But, let me make a guess: cph is the result of coxph, and the model has both covariates and a strata You

Re: [R] Question on plotCI function

2013-02-01 Thread li li
Thanks so much for the reply, Ista. I used plotrix library. Here is my example: xx - seq(0.05, 0.95, by=0.05) lower - c(-2.896865, -2.728416, -2.642574, -2.587724, -2.548672, -2.518994, -2.495409, -2.476031, -2.459662, -2.445513, -2.433014, -2.421739, -2.411344, -2.401536, -2.392040, -2.382571,

Re: [R] ks.test and wilcoxon.test results differ from other stat.packages

2013-02-01 Thread Rui Barradas
Hello, As for the KS test, the op might also want to look at Simard, L'Ecuyer (2011) http://www.jstatsoft.org/v39/i11 for an account on the different algorithms available, and their accuracy. Apparently, R uses different algorithms according to the test in question. See the details section of

Re: [R] Relative Risk in logistic regression

2013-02-01 Thread Ivan-K
Dear colleagues, I have 2 points: One opinion and one question. 1) In one paper in a peer-reviewed journal, I read about the idea of using a logit regression as a surrogate for the log-binomial, just adding the numerator to the denominator ... It’s tempting to immediately get the RR instead of

Re: [R] Question on plotCI function

2013-02-01 Thread MacQueen, Don
You haven't given any y values to plotCI. Try, for example, plotCI(xx, (lower+upper)/2, ui=upper, (etc) What you got was in effect plot( seq(along=xx), xx ) which is standard behavior for plot() when no y values are supplied. -Don -- Don MacQueen Lawrence Livermore National Laboratory

Re: [R] Summary of data for each year

2013-02-01 Thread Felipe Carrillo
 Here is another option using plyr:   library(plyr) creek - read.csv(creek.csv)  library(ggplot2)  creek[1:10,]  colnames(creek) - c(date,flow)  creek$date - as.Date(creek$date, %m/%d/%Y)   ddply(creek,year,summarise,MED=median(flow),MEAN=mean(flow),SD=sd(flow),MIN=min(flow)) Felipe D. Carrillo

[R] Range difference of plot two arrays in one plot

2013-02-01 Thread Yuan, Rebecca
Hello all, When I tried to plot the following two arrays in one figure with the following: x = c(0,0,0,10,20,30) y = c(40,50,60,70,80,90) plot(x, type='o', ylim=c(min(x),max(x))) par(new=T) plot(y, type='l', ylim=c(min(y),max(y))) Found that the first points and last points from those two

[R] [R-pkgs] Version 1.2 of pa package available on CRAN

2013-02-01 Thread Yang Lu
Dear useRs, Version 1.2 of the R package 'pa' is now available on CRAN. This package provides tools for conducting equity portfolio attribution. Two methods included in the package are the Brinson Method and a regression-based analysis. The new version allows users to view attribution results for

Re: [R] Filter according to the latest data

2013-02-01 Thread nalluri pratap
library(sqldf) k1-data.frame(ID=LETTERS[1:4], No=c(rep(123,3),111), Change=c(final,error,bug fixed,final), Date=c(2013-01-15,2013-01-16,2013-01-17,2013-01-12))   k1$Date=as.Date(as.character(k1$Date),tz=UK)   sqldf(select * from k1 group by No having max(Date)) --- On Fri, 1/2/13, Mat

[R] Error: package/namespace load failed for ‘arm’

2013-02-01 Thread Pernille Heelsberg
Hi! I get the following error messages when trying to run the package 'arm'. library(arm) Error : Functions found when exporting methods from the namespace ‘arm’ which are not S4 generic: ‘fixef’, ‘ranef’ Error: package/namespace load failed for ‘arm’ My R version is: version _

[R] x-axis labelling

2013-02-01 Thread Alfredo Tello
Hi Folks! I have a question regarding an issue on which I´ve read a few threads but can´t resolve -- Labelling every other tick mark on the x-axis using factors. Here´s an example: db-data.frame(date=as.factor(c(1:50)),var=rnorm(50))

[R] Are there a read and write functions for data in the vowpal_wabbit format?

2013-02-01 Thread Roy Lowrance
Has anyone implemented a reader and writer for data in the vowpal wabbit format? It's a format for representing sparse data in ASCII files, see https://github.com/JohnLangford/vowpal_wabbit - Roy [[alternative HTML version deleted]] __

Re: [R] Filter according to the latest data

2013-02-01 Thread arun
Hi, Perhaps, (#Untested) do.call(rbind,lapply(split(dat1,dat1$No),function(x) tail(x,1))) #or library(plyr) ddply(dat1,.(No), function(x) x[nrow(x),]) A.K. - Original Message - From: Mat matthias.we...@fnt.de To: r-help@r-project.org Cc: Sent: Friday, February 1, 2013 3:04 AM Subject:

[R] Doing mixed stock analysis with predict function using DFA

2013-02-01 Thread Melanie Zoelck
Dear R Help Mailing List Members, I have some baseline data (attached) on which I plan to run a DFA in R to find out the best predictor variables that best allow discrimination between the different stocks. I then need to apply this DFA function to the mixed data set (attached), which

Re: [R] use name (not values!) of a dataframe inside a funktion

2013-02-01 Thread Greg Snow
It is strongly discouraged in R to have functions that change data values in the global workspace (or any location other than their local environment). The usual procedure in R is to have your function return a modified version of the object and the user then decides what to do with it. They can

Re: [R] glm poisson and quasipoisson

2013-02-01 Thread Ivan-K
I am sure, that this is not a pure Poisson! Huge overdispersion! You get inflated confidence intervals! (although, the point estimates of the regression coefficients stay the same) Try to look for the causes of overdispersion! It may be geteroscedastisity? What is the nature of the response, is

Re: [R] Relative Risk in logistic regression

2013-02-01 Thread Greg Snow
Ivan, In reference to your part 2), in 1989 Li and Duan published a paper where they examined the effect of using the wrong link function ( http://projecteuclid.org/DPubS?service=UIversion=1.0verb=Displayhandle=euclid.aos/1176347254). The short version is that they found that in common models

Re: [R] glm poisson and quasipoisson

2013-02-01 Thread ilai
On Thu, Jan 31, 2013 at 2:13 PM, Wim Kreinen wkrei...@gmail.com wrote: Hello, I have a question about modelling via glm. I think you are way off track. Either the data, glm, or both, are not what you think they are. I have a dataset skn300.tab - structure(list(n = 1:97, freq = c(0L, 0L,

[R] Correcting and Adding to Data Frame

2013-02-01 Thread Rich Shepard
Running on Slackware here with R-2.15.2. There is a data frame I need to edit to correct mis-spellings and to add a row. I used the edit() command with emacs but could not find the mis-spelled strings nor figure out how to add another row. The data frame is stored in

Re: [R] Range difference of plot two arrays in one plot

2013-02-01 Thread Jeff Newmiller
One method is to follow correct usage of base graphics and only use the plot function once for each plot. To overlay, use a function like points or lines. Another approach is to use lattice graphics or ggplot2 and give the data to higher-level plot routines that know how to plot multiple groups

Re: [R] Range difference of plot two arrays in one plot

2013-02-01 Thread Yuan, Rebecca
Hello David, When I used the same ylim for both plots, I got what I need: x = c(0,0,0,10,20,30) y = c(40,50,60,70,80,90) plot(x, type='o', ylim=c(min(x,y),max(x,y))) par(new=T) plot(y, type='l', ylim=c(min(x,y),max(x,y))) Thanks, Rebecca -Original Message- From: David Winsemius

Re: [R] Transforming 4x3 data frame into 2 column df in R

2013-02-01 Thread arun
Hi, library(reshape) foo$id-row.names(foo)  melt(foo,id.var=id)    id variable  value #1   n    w 1.51550092 #2   q    w 0.09977303 #3   r    w 1.17083866 #4   n    x 1.43375720 #5   q    x 0.81737610 #6   r    x 1.24693470 #7   n    y 1.27916240 #8   q    y

Re: [R] CFA with lavaan or with SEM

2013-02-01 Thread Rick Bilonick
Not sure if you are aware of the OpenMx SEM package (http://openmx.psyc.virginia.edu/). It's a very full-featured structural equation modeling package. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Summary of data for each year

2013-02-01 Thread arun
Hi, You could use: creek - read.csv(creek.csv,sep=\t)  colnames(creek) - c(date,flow) creek$date - as.Date(creek$date, %m/%d/%Y) creek1 - within(creek, year - format(date, '%Y')) library(data.table)  creek2- data.table(creek1)  

Re: [R] obtainl survival curves for single strata

2013-02-01 Thread Bond, Stephen
Dr. Therneau, You are correct about the fit: (cph.approve - coxph(Surv(fundterm,resp)~I(CommitAmt/1e5)+res+CommitedRate+dayflag+mth+strata(termfac), data=dfa, subset=(HedgeDate2012-11-15 p1!=FixedOpen), method=efron)) However the output from survfit has individuals in each column and the

[R] heatmap tile size question

2013-02-01 Thread Iain Gallagher
Hello List I was wondering if it is possible to make the individual 'tiles' in a heatmap larger. Often when I plot heatmaps and want to label the rows with eg gene names I either have to shrink the text or leave it out altogether as it becomes so small as to be unreadable. I wondered if there

Re: [R] Fastest way to compare a single value with all values in one column of a data frame

2013-02-01 Thread Dimitri Liakhovitski
I've compared the solutions. *Solution 1:* myf - function( df1, df2 ){ cond - df2$a min(df1$a) if( cond ) { idx - which( df1$a == min(df1$a) ) df1[idx, ] - df2[1, ] } df1 } # On a larger example, set.seed(4530) tst - data.frame(item = 1:1000,a = rnorm(1000),b = rnorm(1000)) #

[R] Change default order of colors line types

2013-02-01 Thread Soyeon Kim
Dear R users, I'd like to change the default order of colors line types. Especially I am using ggplot2 and using color Set1. In Set1, the default color order is red, blue, green, violet,.. ect. However, I want to put red in fourth (not first). Likewise, I want to change the order of default

[R] Loading a list into the environment

2013-02-01 Thread Jonathan Greenberg
R-helpers: Say I have a list: myvariables - list(a=1:10,b=20) Is there a way to load the list components into the environment as variables based on the component names? i.e. by applying this theoretical function to myvariables I would have the variables a and b loaded into the environment

[R] Armadillo error in R extension

2013-02-01 Thread Simon Zehnder
Is there anyway with some experience in using armadillo in R C++ extensions? My problem is the following: I programmed a function in a header looking like #include armadillo inline arma::vec foo(input) { ... do something return an arma::vec object } compiling this

[R] Change default order of colors line types

2013-02-01 Thread Soyeon Kim
Dear R users, I'd like to change the default order of colors line types. Especially I am using ggplot2 and using color Set1. In Set1, the default color order is red, blue, green, violet,.. ect. However, I want to put red in fourth (not first). Likewise, I want to change the order of default

[R] order function

2013-02-01 Thread Kripa R
Hi I'm having a simple issue with the order function. When I use the following code my data is not ordered correctly output[order(output[,3]),] Namebeta pval 881 9.09303277751237 0.000100253350483199 74026.40553461638365 0.00010228641631914 4879

[R] order function

2013-02-01 Thread Kripa R
Hi I'm having a simple issue with the order function. When I use the following code my data is not ordered correctly output[order(output[,3]),] Namebeta pval 881 9.09303277751237 0.000100253350483199 74026.40553461638365 0.00010228641631914 4879

Re: [R] cumulative sum by group and under some criteria

2013-02-01 Thread Zjoanna
I am new to this mailing list. Is everything I posted seen for everyone in the mailing list? or just you can see the post? On Fri, Feb 1, 2013 at 11:33 AM, arun kirshna [via R] ml-node+s789695n465731...@n4.nabble.com wrote: HI, Could you show the modified code and also str(dataset)? A.K.

Re: [R] Nested loop and output help

2013-02-01 Thread staysafe23
Thank you very much Petr, I believe I have fixed my inquiry to not use floating points in my cycle as you pointed out and to use the list structure to keep my results. I am still at a loss as to how to run the multiple loops. I have tried quite a few different strategies but my failure seems to

Re: [R] order function

2013-02-01 Thread Duncan Murdoch
On 13-02-01 12:15 PM, Kripa R wrote: Hi I'm having a simple issue with the order function. When I use the following code my data is not ordered correctly output[order(output[,3]),] Namebeta pval 881 9.09303277751237 0.000100253350483199 7402

Re: [R] Loading a list into the environment

2013-02-01 Thread Gabor Grothendieck
On Fri, Feb 1, 2013 at 5:24 PM, Jonathan Greenberg j...@illinois.edu wrote: R-helpers: Say I have a list: myvariables - list(a=1:10,b=20) Is there a way to load the list components into the environment as variables based on the component names? i.e. by applying this theoretical function

Re: [R] Armadillo error in R extension

2013-02-01 Thread Michael Weylandt
Look up the terribly wonderful RcppArmadillo package. MW On Feb 1, 2013, at 8:38 PM, Simon Zehnder szehn...@uni-bonn.de wrote: Is there anyway with some experience in using armadillo in R C++ extensions? My problem is the following: I programmed a function in a header looking like

Re: [R] Armadillo error in R extension

2013-02-01 Thread Dirk Eddelbuettel
On 1 February 2013 at 21:38, Simon Zehnder wrote: | Is there anyway with some experience in using armadillo in R C++ extensions? Yes, sure -- we wrote (and use) a package RcppArmadillo that provides very easy access to Armadillo via Rcpp. | My problem is the following: | | I programmed a

Re: [R] Loading a list into the environment

2013-02-01 Thread Rui Barradas
Hello, Something like this? myfun - function(x, envir = .GlobalEnv){ nm - names(x) for(i in seq_along(nm)) assign(nm[i], x[[i]], envir) } myvariables - list(a=1:10,b=20) myfun(myvariables) a b Hope this helps, Rui Barradas Em 01-02-2013 22:24, Jonathan

Re: [R] Change default order of colors line types

2013-02-01 Thread Jeff Newmiller
Sure. Start by reading [1] and take its advice to heart. Then study the many ways to create factors with values ordered in sync with the color ordering. The color ordering can be set using the default, using any of the various color picker functions, or manually. [1]

[R] mountain lion install, error message

2013-02-01 Thread clairehewson@zen
Hi, I have been trying to install R on my mac which is running mountain lion. It is partially working, but one error message I am getting is: Error in function () : object '.activeModel' not found. I cannot find anything on this by googling. It appears, for example, when I try to 'add

[R] Help calculating p-values

2013-02-01 Thread Jin Choi
I am trying to figure out how to calculate p-values for the difference in prevalence of a risk factor between men and women. For example, I find that 277 out of 710 male patients and 125 out of 305 female patients have obesity, what is the p-value for their difference? If there is a package that

Re: [R] Help calculating p-values

2013-02-01 Thread Bert Gunter
This is very basic stuff, so I think your main problem is statistical, not R related. Try posting on stats.stackexchange.com to get statistical advice or do some reading about differences in proportions, contingency tables, and the like. Incidentally, off the top of my head, I'd say there's no

Re: [R] mountain lion install, error message

2013-02-01 Thread Jeff Newmiller
Perhaps you would benefit from joining R-sig-mac, and/or perusing their archives. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#.

Re: [R] mountain lion install, error message

2013-02-01 Thread John Fox
Dear Claire, This error is due to a bug in the previous version of the Rcmdr package; it is fixed in the current version on CRAN, version 1.9-4. Simply reinstall the Rcmdr package from CRAN and verify that you have the correct version. I hope this helps, John -Original Message- From:

Re: [R] mountain lion install, error message

2013-02-01 Thread John Fox
Dear Jeff, As I just explained to Claire, this error is caused by a bug in an earlier version of the Rcmdr package; the bug affects the Rcmdr on all platforms, not just Mac OS X, and is fixed in the current version 1.9-4 of the Rcmdr on CRAN. Best, John -Original Message- From:

Re: [R] x-axis labelling

2013-02-01 Thread David Winsemius
On Feb 1, 2013, at 9:30 AM, Alfredo Tello wrote: Hi Folks! I have a question regarding an issue on which I´ve read a few threads but can´t resolve -- Labelling every other tick mark on the x-axis using factors. Here´s an example: Why not:

Re: [R] repeating autocovariate functions

2013-02-01 Thread rachel buxton
Hi there, Just wondering why my post was rejected? cheersRachel Subject: repeating autocovariate functions From: r-help-ow...@r-project.org To: moy...@hotmail.com Date: Sat, 2 Feb 2013 02:56:27 +0100 Message rejected by filter rule match --Forwarded Message Attachment-- Date: Fri, 1 Feb

Re: [R] Help calculating p-values

2013-02-01 Thread Rolf Turner
This smacks of homework to me. cheers, Rolf Turner On 02/02/2013 12:45 PM, Jin Choi wrote: I am trying to figure out how to calculate p-values for the difference in prevalence of a risk factor between men and women. For example, I find that 277 out of 710 male patients and 125

[R] Choice of text for intermediate level R programming course

2013-02-01 Thread William Grove
The Subject line mostly says it. I'm designing it as a semester-long, 3 hours per week, course that takes in students who got the basics of R in stats classes, but don't really know how to program in it. Translation: if their own examples don't look enough like examples from previous work,

Re: [R] cumulative sum by group and under some criteria

2013-02-01 Thread arun
Hi, Saw your reply on Nabble: #Your code: library(zoo) res1- do.call(rbind,lapply(lapply(split(d,list(d$m1,d$n1)),function(x)   {x$cterm1_p0L[x$Qm=c11]- cumsum(x$term1_p0[x$Qm=c11]);    x$cterm1_p0H[x$Qn=c12]- cumsum(x$term1_p0[x$Qn=c12]);    x$cterm1_p1L[x$Qm=c11]- cumsum(x$term1_p1[x$Qm=c11]); 

Re: [R] cumulative sum by group and under some criteria

2013-02-01 Thread arun
HI, I think this should be more correct: maxN-9  c11-0.2  c12-0.2  p0L-0.05  p0H-0.05  p1L-0.20  p1H-0.20  d - structure(list(m1 = c(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,  2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),      n1 = c(2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 

Re: [R] repeating autocovariate functions

2013-02-01 Thread David Winsemius
The short answer is ... because it was from Nabble. The longer answer is that the filters needed to be tightened on Nabble postings because of a an autobot spammer and the moderation queue was being swamped with cases. If you send your questions as email (from your email client) to