Re: [R] Is there a way to export regression output to an excel spreadsheet?

2012-11-09 Thread Duncan Mackay
Hi If you want a formatted output then some of the packages may be of use library(R2THML) ?HTML.ftable library(xtable) ? xtable there may be functions in the Hmisc /rms packages as well Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 E

Re: [R] Why does my regression output look like this?

2012-11-09 Thread Jeff Newmiller
Have you really never encountered scientific notation? http://en.m.wikipedia.org/wiki/Scientific_notation --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#.

Re: [R] Is there a way to export regression output to an excel spreadsheet?

2012-11-09 Thread Jeff Newmiller
This is the help-you-learn-R mailing list, not the do-my-work-for-me mailing list. I don't know where the latter is. To assist you in the former vein, I recommend that you read the posting guide mentioned at the footer of every email on this list. It will tell you some useful hints on interpret

Re: [R] Is there a way to export regression output to an excel spreadsheet?

2012-11-09 Thread chuck.01
Yes. see: ?lm ?coef ?write.csv also, if fit <- lm(Y~X) then: slope_p-value <- summary(fit)[[4]][2,4] Double check that last one for yourself. Good luck. hoguejm wrote > I want to export the coefficient values and p-values from my regression > output into a spreadsheet. Is there a way to

Re: [R] Is there a way to export regression output to an excel spreadsheet?

2012-11-09 Thread hoguejm
I am very very new with R. Needless to say, your comment is a bit confusing. My regression name is "mylogit" Anyway to write a code that I can copy paste? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Is-there-a-way-to-export-regression-output-to-an-excel-spreadshe

[R] Why does my regression output look like this?

2012-11-09 Thread hoguejm
EstimateStd. Error z value Pr(>|z|) (Intercept) 2.338e+00 2.400e+03 0.0010.99922 fac

[R] Is there a way to export regression output to an excel spreadsheet?

2012-11-09 Thread hoguejm
I want to export the coefficient values and p-values from my regression output into a spreadsheet. Is there a way to do this? -- View this message in context: http://r.789695.n4.nabble.com/Is-there-a-way-to-export-regression-output-to-an-excel-spreadsheet-tp4649155.html Sent from the R help mai

Re: [R] problem with package development and older defs earlier in search order

2012-11-09 Thread Rolf Turner
On 10/11/12 12:08, Martin J Reed wrote: Rolf and Duncan Many thanks. Your answers pointed me to a refinement that is closer to what I want: rm(list=intersect(ls(".GlobalEnv"),ls("package:reedgraph")), pos=".GlobalEnv") This only removes items that are "masked" by GlobalEnv from my pa

Re: [R] decorating API in R

2012-11-09 Thread Barry Rowlingson
On Fri, Nov 9, 2012 at 9:10 PM, Tom Roche wrote: > > How best to implement a decorator pattern in R? What I mean, why I ask: > > A group of ncdf4 users is trying to make it easier (notably for ourselves :-) > to write correctly IOAPI-formatted netCDF. Since IOAPI > > http://www.baronams.com/produ

Re: [R] problem with package development and older defs earlier in search order

2012-11-09 Thread Martin J Reed
Rolf and Duncan Many thanks. Your answers pointed me to a refinement that is closer to what I want: rm(list=intersect(ls(".GlobalEnv"),ls("package:reedgraph")), pos=".GlobalEnv") This only removes items that are "masked" by GlobalEnv from my package. As this is a bit long for some of th

[R] Can pgmm in the plm package include additional endogenous variables?

2012-11-09 Thread Ruiqing Miao
Dear R-Users, I am using pgmm in the plm package to estimate a dynamic models with panel data. Besides the lagged dependent variable, I also have some other endogenous variables. Does the pgmm have an argument that allows me to specify these endogenous variables and their instruments? I didn't

Re: [R] lm function - na.action

2012-11-09 Thread R. Michael Weylandt
On Fri, Nov 9, 2012 at 5:21 PM, tesssa wrote: > How do you lm throw away excess data points. I am following the > documentation with no success Why would you want to throw away this data? I think that's generally considered sub-optimal model-fitting technique, thought it might explain your diffi

Re: [R] using lapply with recode

2012-11-09 Thread arun
HI, I found the reason why my first suggestion didn't work out: mylist<-list(df1=data.frame(a=seq(1,10,1), b=sample(1:15,10,replace=FALSE),prov=c(rep('QUE', 5), rep('BC', 5))), df2=data.frame(prov=c(rep('Quebec', 5), rep('AB', 5)),a=seq(1,10,1),b=sample(1:25,10,replace=FALSE)))   lapply(myli

Re: [R] as.data.frame(do.call(rbind, lapply)) produces something weird

2012-11-09 Thread William Dunlap
Note that the column-wise conversion I suggested might be better done on the matrix R before conversion to a data.frame. E.g. > R <- rbind( list(Letter="a", Integer=1L, Complex=1+1i), list(Letter="b", Integer=2L, Complex=2+2i)) > Rconverted <- lapply(structure(seq_len(ncol(R

Re: [R] Counting the numbers of items in vector according to their size

2012-11-09 Thread Rui Barradas
Hello, As you know R better it will take you less and less time to get it right, and almost surely less and less lines of code to do the same thing. Here's a one liner: set.seed(1510) s=numeric(length=10) for(i in 1:10){ pop=(rbeta(n=20,shape1=2,shape2=1)) s[i]=sum(pop) } set.se

Re: [R] as.data.frame(do.call(rbind, lapply)) produces something weird

2012-11-09 Thread David Winsemius
On Nov 9, 2012, at 11:21 AM, Sam Steingold wrote: > The following code: > --8<---cut here---start->8--- >> myfun <- function (x) list(x=x,y=x*x) >> z <- as.data.frame(do.call(rbind,lapply(1:3,function(x) Winsemius' Corollary: Kurt Gödel's Incomprehension The

[R] decorating API in R

2012-11-09 Thread Tom Roche
How best to implement a decorator pattern in R? What I mean, why I ask: A group of ncdf4 users is trying to make it easier (notably for ourselves :-) to write correctly IOAPI-formatted netCDF. Since IOAPI http://www.baronams.com/products/ioapi/ decorates netCDF, one obvious way to do a package

Re: [R] sink() doesn't work

2012-11-09 Thread jim holtman
sink.number() will give you an idea of how many 'sinks' you might have nested. On Fri, Nov 9, 2012 at 2:07 PM, Dan Baron wrote: > Oftentimes I want to make outputs to be displayed on the R console. > However, after I execute a program with a sink command in it the R console > becomes unresponsive

Re: [R] as.data.frame(do.call(rbind, lapply)) produces something weird

2012-11-09 Thread jim holtman
This is a case where you start by breaking down you complex one-liner into separate statements and examine what the results are at each point. This is what I would have to do with the script you posted. I think as Bill pointed out, one of your function calls is probably creating a result that you

Re: [R] as.data.frame(do.call(rbind, lapply)) produces something weird

2012-11-09 Thread arun
HI, If you don't want to list the column names explicitly, you can try this:  z1<-as.data.frame(do.call(rbind,lapply(1:3,function(x) c(a=paste("a",x,sep=""),unlist(do.call(c,list(b=myfun(x),c=myfun(x*x*x z2<-z1[,-1]  z2[]<-sapply(z2,function(x) as.numeric(as.character(x))) data.frame(a=z1

Re: [R] Logistic curve fitting with y values >1 (R version 2.15.2, OS is OS X 10.6.8)

2012-11-09 Thread Marc Schwartz
On Nov 9, 2012, at 12:52 PM, Jacob B. wrote: > Hello, > > I'm trying to fit a logistic curve to data but I'm having a hard time > discovering how. Every tutorial I've come across either assumes the > logistic curve has 0 > I simply have two vectors, a and b, of equal length with no missing > d

Re: [R] Fwd: Simulate nested data

2012-11-09 Thread Greg Snow
There are still a lot of things that you did not specify, but maybe this will get you started: n.groups <- sample(3:6, 1) n.species <- sample(2:10, n.groups, replace=TRUE) n.animals <- sample( 10:25, sum(n.species), replace=TRUE ) mu.g <- rnorm(n.groups, 100, 50) mu.species <- rnorm( sum(n.species

Re: [R] lm function - strange error

2012-11-09 Thread John Kane
Actually it was not tessa but the original document that was at fault. I suspect you may be right that the 0 should not be there but it was in the document. In any case look at these conc = c(10, 20, 30, 40, 50) signal = c (4, 22, 44, 60, 82) lm.r1 <- lm( signal ~ conc) s

Re: [R] Fwd: Simulate nested data

2012-11-09 Thread Sarah Goslee
On Fri, Nov 9, 2012 at 3:12 PM, Andrea Goijman wrote: > Thanks Sarah, > > Ok, I'll start over... forget the functions that I wrote before and lets > start from scratch. > Suppose I want to simulate data; for example n species that belong to g > groups. Lets say 10 species, where 4 belong to group

Re: [R] as.data.frame(do.call(rbind, lapply)) produces something weird

2012-11-09 Thread William Dunlap
Your call to rbind() creates matrix of mode "list". Thus every element can be of a different type, although you "know" that there is a pattern to the types. E.g., > R <- rbind( list(Letter="a", Integer=1L, Complex=1+1i), list(Letter="b", Integer=2L, Complex=2+2i)) > str(R)

Re: [R] R and google analytics

2012-11-09 Thread Ista Zahn
Hi, I would start by installing the packages from CRAN instead of omegahat: install.packages(c("XML", "RCurl")) If you continue to have problems, try posting on the R-SIG-MAC list (https://stat.ethz.ch/mailman/listinfo/r-sig-mac) Best, Ista On Fri, Nov 9, 2012 at 12:53 PM, tmbassassin wrote:

Re: [R] lm function - strange error

2012-11-09 Thread John Kane
> -Original Message- > From: sarah.gos...@gmail.com > Sent: Fri, 9 Nov 2012 14:34:57 -0500 > To: jrkrid...@inbox.com > Subject: Re: [R] lm function - strange error > > On Fri, Nov 9, 2012 at 2:20 PM, John Kane wrote: >> >>> -Original Message- >>> From: dwinsem...@comcast.net >>>

Re: [R] Fwd: Simulate nested data

2012-11-09 Thread Andrea Goijman
Thanks Sarah, Ok, I'll start over... forget the functions that I wrote before and lets start from scratch. Suppose I want to simulate data; for example n species that belong to g groups. Lets say 10 species, where 4 belong to group 1, 3 to group 2, and the rest to group 3. I want to simulate those

Re: [R] mean and kurtosis

2012-11-09 Thread John Kane
http://www.statmethods.net/stats/descriptives.html the psych package seems to do what you wan set.seed(235) mydata <- data.frame(aa = rnorm(20), bb = rnorm(20) , cc = rnorm(20)) library(psych) describe(mydata) John Kane Kingston ON Canada > -Original Message- > From: powella...@g

Re: [R] Finding the percentage of points in a designated vector

2012-11-09 Thread David Winsemius
On Nov 9, 2012, at 9:52 AM, Ricky Corp wrote: > I am new to R and learned to program 10 years ago in C++. I am currently > working a project that looks at the distribution of randomly generated beta > values. I take 20 random beta values find their sum, repeat 10 times. > > Here is my code t

Re: [R] Fwd: Simulate nested data

2012-11-09 Thread Sarah Goslee
Andrea, I don't understand what you want. Why don't you start over, and explain what the inputs are, and what your desired outputs are. Using your previous code: # pre-specified number of groups groups <- 3 # what is species? It needs to be defined before # we can assign a value to a component o

Re: [R] as.data.frame(do.call(rbind, lapply)) produces something weird

2012-11-09 Thread Sam Steingold
> * arun [2012-11-09 11:33:43 -0800]: > > z2<-within(z1,{b.x<-as.numeric(as.character(b.x));b.y<-as.numeric(as.character(b.y));c.x<-as.numeric(as.character(c.x));c.y<-as.numeric(as.character(c.y))}) 1. I don't want to have to list all the column names explicitly 2. I find the num->char->num conv

Re: [R] Fwd: Simulate nested data

2012-11-09 Thread Andrea Goijman
Yes, I tried your suggestion, but it didn't help. It just creates a tri-dimentional array for p... and that is not what I want p per species (within groups) to be an unbalanced array... I need to have a single value of p per species, and the total number of elements in p would be whatever number r

[R] mean and kurtosis

2012-11-09 Thread Adel Powell
Need help! I know how to get the mean and kurtosis for a single variable but I am reading in an excel file that has several columns representing variables. I need a way to find descriptive statistics across ALL the variables? [[alternative HTML version deleted]] __

Re: [R] sink() doesn't work

2012-11-09 Thread Sarah Goslee
We can't really diagnose the problem without a repeatable example (that is, what's in your R file?). But my suspicion is that you've called sink(filename) more than once. Simply type sink() at the command prompt until you get the warning: In sink() : no sink to remove And then all should be well

Re: [R] Fwd: Simulate nested data

2012-11-09 Thread Sarah Goslee
Andrea, I simply meant that I couldn't run your code assigning a value to species$groups because the code didn't include any information about creating the R object species. Thus, I changed the name of that R object to speciesgroups and altered your code so that it runs by removing the erroneous c

Re: [R] Mean of matrices entries in list of lists

2012-11-09 Thread arun
HI, It is better to have a reproducible example to work with.  I hope this helps you. library(reshape) library(zoo) set.seed(132) list1<-lapply(1:13,function(x) lapply(1:12,function(x) data.frame(col1=sample(1:50,5,replace=TRUE),col2=sample(1:150,5,replace=TRUE names(list1)<-2000:2012 na

Re: [R] Fwd: Simulate nested data

2012-11-09 Thread Andrea Goijman
Hi Sarah, Maybe I expressed myself wrong, but so far, I don't have the species; I'm just wanting to generate simulated data. For example, creating an unbalanced (and random) number of species per group, and then run the for-loops for example: Group1: 3 species Group2: 5 species Group3: 8 species

Re: [R] lm function - strange error

2012-11-09 Thread Tom Shatwell
Hi Tessa, I agree with John. I think you've made a typo, but looking at your data I think the zero concentration should not be there. Try plotting it. conc = c(10, 20, 30, 40, 50) signal = c (4, 22, 44, 60, 82) plot(signal~conc) abline(lm(signal~conc)) 2012/11/9 John Kane > Tessa, > > Would y

[R] Logistic curve fitting with y values >1 (R version 2.15.2, OS is OS X 10.6.8)

2012-11-09 Thread Jacob B.
Hello, I'm trying to fit a logistic curve to data but I'm having a hard time discovering how. Every tutorial I've come across either assumes the logistic curve has 0http://www.apsnet.org/EDCENTER/ADVANCED/TOPICS/ECOLOGYANDEPIDEMIOLOGYINR/DISEASEPROGRESS/Pages/NonlinearRegression.aspx, which assum

Re: [R] lm function - strange error

2012-11-09 Thread Sarah Goslee
On Fri, Nov 9, 2012 at 2:20 PM, John Kane wrote: > >> -Original Message- >> From: dwinsem...@comcast.net >> Sent: Fri, 9 Nov 2012 10:56:48 -0800 >> To: tesara...@gmail.com >> Subject: Re: [R] lm function - strange error >> >> >> On Nov 9, 2012, at 9:16 AM, tesssa wrote: >> >>> Sorry it is

Re: [R] Breakpoints and non linear regression

2012-11-09 Thread Thomas Coquet
Hello, I already tried and looked at the bfast package (very nice package by the way!) as I am working on VI time series as well. However, my model is definitely not linear, so in worst case scenario my idea was to use the bfast package to find the breakpoints (with the harmonic fit) and then to

[R] sink() doesn't work

2012-11-09 Thread Dan Baron
Oftentimes I want to make outputs to be displayed on the R console. However, after I execute a program with a sink command in it the R console becomes unresponsive. Meaning that the following occurs in R console: > source("Program_containing_sink.R") > a<-1 > a > >sink() >a > R help says that sin

Re: [R] as.data.frame(do.call(rbind, lapply)) produces something weird

2012-11-09 Thread arun
Hi, May be this helps: z1<-as.data.frame(do.call(rbind,lapply(1:3,function(x) c(a=paste("a",x,sep=""),unlist(do.call(c,list(b=myfun(x),c=myfun(x*x*x z2<-within(z1,{b.x<-as.numeric(as.character(b.x));b.y<-as.numeric(as.character(b.y));c.x<-as.numeric(as.character(c.x));c.y<-as.numeric(as.ch

Re: [R] Fwd: Simulate nested data

2012-11-09 Thread Sarah Goslee
Hi Andrea, Without knowing what species is, I can't run your code as is, but try this: groups<-3 speciesgroups <- as.integer(runif(groups,1,10)) # I'd use sample(1:10, groups, replace=TRUE) p<-array(NA,dim=speciesgroups) Mostly you're trying to use c() on something that's already a vector. Sa

Re: [R] lm function - strange error

2012-11-09 Thread John Kane
> -Original Message- > From: dwinsem...@comcast.net > Sent: Fri, 9 Nov 2012 10:56:48 -0800 > To: tesara...@gmail.com > Subject: Re: [R] lm function - strange error > > > On Nov 9, 2012, at 9:16 AM, tesssa wrote: > >> Sorry it is not a comma but a tilda. The R.help message editor Pl

Re: [R] Problem with

2012-11-09 Thread David Winsemius
On Nov 9, 2012, at 9:52 AM, Haszun wrote: > Hi, can someone tell me what is wrong in this function: > > ilecyfr=function(x){ > if (x=0){ > return(1) > } else { > k=0 > while (abs(x)/10^k >0) { > k=k+1 > } return(k) > }} > So if x == 0 (that's your first error and possibly a fatal one, but let

Re: [R] Breakpoints and non linear regression

2012-11-09 Thread Achim Zeileis
On Fri, 9 Nov 2012, Thomas Coquet wrote: Hello, I already tried and looked at the bfast package (very nice package by the way!) as I am working on VI time series as well. Good! :-) However, my model is definitely not linear, Not even after taking logs or some other transformation? In prin

Re: [R] lm function - strange error

2012-11-09 Thread John Kane
Tessa, Would you please leave in the context --that is your early remarks and mine? Most of us on the R-help list do no use nabble and it is really annoying to have to go there to see what was discussed. I suspect that a lot of readers just don't bother and nabble users lose a lot of possible

Re: [R] R function data variable name argument

2012-11-09 Thread Sarah Goslee
Hi, If you move the read.csv statement outside the function and instead pass the data as an argument, then you can provide a reproducible example using dput(head(drugs, 20)) or a similar fake dataset. It's really hard to debug code without knowing what kind of data it is supposed to act upon. In

[R] as.data.frame(do.call(rbind,lapply)) produces something weird

2012-11-09 Thread Sam Steingold
The following code: --8<---cut here---start->8--- > myfun <- function (x) list(x=x,y=x*x) > z <- as.data.frame(do.call(rbind,lapply(1:3,function(x) > c(a=paste("a",x,sep=""),as.list(unlist(list(b=myfun(x),c=myfun(x*x*x > z a b.x b.y c.x c.y 1 a1 1

Re: [R] Problem with

2012-11-09 Thread Sarah Goslee
And your problem is? Please note that the test for equality is == while the preferred assignment operator is <- Beyond that, some statement of what you're trying to accomplish and an actual executable example would be useful. Sarah On Fri, Nov 9, 2012 at 12:53 PM, Haszun wrote: > * > ilecyfr=f

[R] Fwd: Simulate nested data

2012-11-09 Thread Andrea Goijman
I know this seems like a very easy question (and maye it is) but I've been trying to simulate nested data and been unsucessful so far.. I want to simulate a varying number of species within a group; and then create an array to store the results of my for-loop. For example: groups<-3 species$group

Re: [R] Breakpoints and non linear regression

2012-11-09 Thread Achim Zeileis
On Fri, 9 Nov 2012, thomas88 wrote: Hello, I have done some research about breakpoints (I am not a statistician) and I found out about the breakpoint, strucchange and segmented packages in R allowing to find breakpoints assuming linear model. However, I would like to fit a periodic time series

Re: [R] lm function - strange error

2012-11-09 Thread David Winsemius
On Nov 9, 2012, at 9:16 AM, tesssa wrote: > Sorry it is not a comma but a tilda. The R.help message editor Please > replace the dash with a tilda as lm function requires It might be interesting to have such a supernatural entity zooming around the Rhelp Universe answering prayers from newbi

Re: [R] Running a loop of random generated sums

2012-11-09 Thread David Winsemius
On Nov 9, 2012, at 9:07 AM, rlcorp wrote: > I also would like to sort the values that are greater than 10 in one vector > and less than or equal to 10 in another vector. > x <- 1:20 x[x>10] x[x<=10] -- David Winsemius, MD Alameda, CA, USA __ R-he

[R] Script for searching in a kinship matrix

2012-11-09 Thread ginger
Hi everybody! In a case-control study I have already sampled cases stratifying for sex (0,1) and age (<62y, >=62y). I need to sample a group of controls with the same characteristics (which I can easily do) plus one more: the level of relatedness. Therefore controls should be matched to cases for s

[R] 10-Fold Cross Validation AND Random Forest

2012-11-09 Thread Lopez, Dan
Hi, I am using the Random Forest package to classify observations into one of two classes. My data is unbalanced with the minority class accounting for 7% of total data set. I have heard the 10-Fold Cross validation can help me with improving classification. But being new at most of this it's

[R] Problem with

2012-11-09 Thread Haszun
Hi, can someone tell me what is wrong in this function: ilecyfr=function(x){ if (x=0){ return(1) } else { k=0 while (abs(x)/10^k >0) { k=k+1 } return(k) }} -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-tp4649082.html Sent from the R help mailing list archive at N

[R] R and google analytics

2012-11-09 Thread tmbassassin
so... i'm trying to integrate google analytics with R (statistics)-- i know it's possible, there's a lot of documentation and some walkthroughs on how to do it, but i can't for the LIFE of me get it to work or even know where to begin. for starters, the directions i'm following are from this web

[R] Counting the numbers of items in vector according to their size

2012-11-09 Thread rlcorp
I am new to R and learned to program 10 years ago in C++. I am currently working a project that looks at the distribution of randomly generated beta values. I take 20 random beta values find their sum, repeat 10 times. Here is my code that it took me 4 hours to get s=numeric(length=10) fo

[R] Finding the percentage of points in a designated vector

2012-11-09 Thread Ricky Corp
I am new to R and learned to program 10 years ago in C++. I am currently working a project that looks at the distribution of randomly generated beta values. I take 20 random beta values find their sum, repeat 10 times. Here is my code that it took me 4 hours to get s=numeric(length=10) fo

Re: [R] lm function - strange error

2012-11-09 Thread tesssa
Here is the document http://www.montefiore.ulg.ac.be/~kvansteen/GBIO0009-1/ac20092010/Class8/Using%20R%20for%20linear%20regression.pdf -- View this message in context: http://r.789695.n4.nabble.com/lm-function-strange-error-tp4649065p4649080.html Sent from the R help mailing list archive at Na

Re: [R] Problem with

2012-11-09 Thread Haszun
* ilecyfr=function(x){ if (x=0){ return(1) } else { k=0 while (abs(x)/10^k >1) { k=k+1 } return(k) }} -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-tp4649082p4649084.html Sent from the R help mailing list archive at Nabble.com. ___

[R] R function data variable name argument

2012-11-09 Thread Le Lait, Marie-Claire
Hello fellow R-ers, I have spent some time on this and it is driving me NUTS! I am sure there is a solution, so please help. I am trying to create a function that will plot different lines for subsets of a dataset. For example, I am trying to look at different drug groups (drug2), let's say 1,2

[R] lm function - na.action

2012-11-09 Thread tesssa
How do you lm throw away excess data points. I am following the documentation with no success -- View this message in context: http://r.789695.n4.nabble.com/lm-function-na-action-tp4649075.html Sent from the R help mailing list archive at Nabble.com. ___

[R] Kinship2 and GenABEL

2012-11-09 Thread Silvano Cesar da Costa
Hi, I'm using kinship2 to calculate heritabilty, but I would like calculate in GenABEL too. I trying the code: > require(kinship2) > require(GenABEL) > pedig = with(Dados, pedigree(id=IID, dadid=PAT, momid=MAT, sex=SEX, famid=FID, missid=0)) > kmat = kinship(pedig) > (mod1

Re: [R] lm function - strange error

2012-11-09 Thread tesssa
Sorry it is not a comma but a tilda. The R.help message editor Please replace the dash with a tilda as lm function requires -- View this message in context: http://r.789695.n4.nabble.com/lm-function-strange-error-tp4649065p4649074.html Sent from the R help mailing list archive at Nabbl

[R] Breakpoints and non linear regression

2012-11-09 Thread thomas88
Hello, I have done some research about breakpoints (I am not a statistician) and I found out about the breakpoint, strucchange and segmented packages in R allowing to find breakpoints assuming linear model. However, I would like to fit a periodic time series with a non linear (periodic) model, an

Re: [R] Running a loop of random generated sums

2012-11-09 Thread rlcorp
I also would like to sort the values that are greater than 10 in one vector and less than or equal to 10 in another vector. -- View this message in context: http://r.789695.n4.nabble.com/Running-a-loop-of-random-generated-sums-tp4649013p4649070.html Sent from the R help mailing list archive at

Re: [R] Remove missings (quick question)

2012-11-09 Thread Marc Schwartz
On Nov 9, 2012, at 11:23 AM, Bert Gunter wrote: > Marc et. al: > > On Fri, Nov 9, 2012 at 9:05 AM, Marc Schwartz wrote: >> On Nov 9, 2012, at 10:50 AM, Eiko Fried wrote: >> >>> A colleague wrote the following syntax for me: >>> >>> D = read.csv("x.csv") >>> >>> ## Convert -999 to NA >>> fo

Re: [R] Help with lme

2012-11-09 Thread Annie Hoen
Thank you both!! Great to know. I've posted my question to r-sig-mixed-models. Thanks again! Annie On 11/9/12 12:53 PM, "R. Michael Weylandt" wrote: >On Fri, Nov 9, 2012 at 5:27 PM, Bert Gunter >wrote: >> Well, you've posted to the wrong list! >> >> First off, you're almost always better off po

Re: [R] Help with lme

2012-11-09 Thread R. Michael Weylandt
On Fri, Nov 9, 2012 at 5:27 PM, Bert Gunter wrote: > Well, you've posted to the wrong list! > > First off, you're almost always better off posting to an R SIG list > when one exists in your area of concern,as it does here: > r-sig-mixed-models. > > Second, this appears to be primarily a statistics

Re: [R] Help with lme

2012-11-09 Thread Bert Gunter
Well, you've posted to the wrong list! First off, you're almost always better off posting to an R SIG list when one exists in your area of concern,as it does here: r-sig-mixed-models. Second, this appears to be primarily a statistics question, and R-help is not a statistics help list (though, I a

Re: [R] lm function - strange error

2012-11-09 Thread John Kane
Can you provide a reference or link to the document? I think that you have a misprint or a typo in it. the na.omit is a reference to missing data that is accounted for in the vector, which would appear as NA in the data. For example this works just fine for me conc = c(0, 10, 20, 30, 40, 50) s

Re: [R] Remove missings (quick question)

2012-11-09 Thread Bert Gunter
Marc et. al: On Fri, Nov 9, 2012 at 9:05 AM, Marc Schwartz wrote: > On Nov 9, 2012, at 10:50 AM, Eiko Fried wrote: > >> A colleague wrote the following syntax for me: >> >> D = read.csv("x.csv") >> >> ## Convert -999 to NA >> for (k in 1:dim(D)[2]) { >>I = which(D[,k]==-999) >>if (length

Re: [R] problem with function "qdagum"

2012-11-09 Thread Uwe Ligges
This is a bug in the unmentioned VGAM package and you have to report it to its maintainer (hence CCing Thomas Yee). Uwe Ligges On 09.11.2012 10:08, Alena888 wrote: I would like to ude the function "qdagum", to compite quantiles of dagum distribution, but if I use the form: >qdagum(0.1, 4, 7

[R] Help with lme

2012-11-09 Thread Annie Hoen
Hi, This is my first time posting to the list so please forgive any breeches of etiquette! I am new to mixed-effects modeling. This is my dataset: subject treatment day replicate outcome 1 1 1 1 0.0 1 1 4 1 0.0 1 1 8

Re: [R] Remove missings (quick question)

2012-11-09 Thread Marc Schwartz
On Nov 9, 2012, at 10:50 AM, Eiko Fried wrote: > A colleague wrote the following syntax for me: > > D = read.csv("x.csv") > > ## Convert -999 to NA > for (k in 1:dim(D)[2]) { >I = which(D[,k]==-999) >if (length(I) > 0) { >D[I,k] = NA >} > } > > The dataset has many missing

Re: [R] R: net reclassification index after Cox survival analysis

2012-11-09 Thread petretta
Many thanks to Prof. Frank Harrell for the comments and for the relevant considerations. In the meantime, I find an R code to estimate the net reclassification improvement (NRI) in the context of censored survival outcomes published by Benjamin French, Paramita Saha-Chaudhuri, Bonnie Ky, Thomas P

Re: [R] lm function - strange error

2012-11-09 Thread R. Michael Weylandt
On Fri, Nov 9, 2012 at 4:37 PM, tesssa wrote: > I am following a document teaching how to use regression and right at the > onset I get an R error. I understand that variables "conc" and "signal" > should have the same length but I am using the what R manual suggests to > drop the error and it i

[R] lm function - strange error

2012-11-09 Thread tesssa
I am following a document teaching how to use regression and right at the onset I get an R error. I understand that variables "conc" and "signal" should have the same length but I am using the what R manual suggests to drop the error and it is not cooperating. What gives? The manual says that

[R] Remove missings (quick question)

2012-11-09 Thread Eiko Fried
A colleague wrote the following syntax for me: D = read.csv("x.csv") ## Convert -999 to NA for (k in 1:dim(D)[2]) { I = which(D[,k]==-999) if (length(I) > 0) { D[I,k] = NA } } The dataset has many missing values. I am running several regressions on this dataset, and want to e

Re: [R] LiblineaR: accept sparse matrices

2012-11-09 Thread Sam Steingold
Hi, > * Thibault Helleputte [2012-11-09 > 09:22:11 +0100]: > > The next release of LiblineaR should offer the possibility of using > sparse matrices. However, the next release date is not fixed yet... thanks. > On Thu, Nov 8, 2012 at 10:07 PM, Sam Steingold wrote: >> >> It would also be nice

Re: [R] if between 500-600 give 550

2012-11-09 Thread David Winsemius
On Nov 9, 2012, at 5:10 AM, Tagmarie wrote: > I have a data frame somewhat like this: > > myframe <- data.frame (ID=c(2,3,4,5), Hunger =c(415,452,550,318 )) > myframe > > Now I would like to add a column to the right which summarizes the values > for Hunger somewhat to reduce the number of val

Re: [R] Simple Likert count data visualization

2012-11-09 Thread Richard M. Heiberger
Werner, Yes, it exists. See the likert function in the HH package. Run the examples in the help file ?likert and the demo to see all the capabilities of the likert function, particularly multiple groupings within the sample population. Discussion and example of multiple groupings are included in

Re: [R] vectorized uni-root?

2012-11-09 Thread Ravi Varadhan
Hi Ivo, The only problem is that uniroot() actually uses Brent's algorithm, and is based on the C code from netlib (there is also Fortran code available - zeroin.f). Brent's algorithm is more sophisticated than a simple bisection approach that you have vectorized. It combines bisection and se

[R] Mean of matrices entries in list of lists

2012-11-09 Thread Flummi
Hey there, I've got a list of lists with matrices: A list with 13 entries (representing years), each of them another list with 12 matrices (representing one month). In each matrix there are as many rows as there are hours in the different months and 2 columns, since two meteorological parameters a

Re: [R] CCA with Vegan - Plot problem

2012-11-09 Thread rumble14
Sorry, just to clarify as I have put .S files in the later response but .csv in the earlier, I have tried with both, changing to read.csv or read.table as appropriate but get the same play of events. H -- View this message in context: http://r.789695.n4.nabble.com/CCA-with-Vegan-Plot-problem-tp

Re: [R] if between 500-600 give 550

2012-11-09 Thread arun
Hi, Try this: myframe$newcol<-ifelse(myframe[,2]>=300 & myframe[,2]<400,350,ifelse(myframe[,2]>=400 &myframe[,2]<500,450,ifelse(myframe[,2]>=500 & myframe[,2]<600,550,NA)))  myframe #  ID Hunger newcol #1  2    415    450 #2  3    452    450 #3  4    550    550 #4  5    318    350 A.K. -

Re: [R] using lapply with recode

2012-11-09 Thread arun
HI, Sorry, I didn't know that "prov" exists in different columns. Try this: #changed your example dataset to include one more column and reordered the columns in list elements mylist<-list(df1=data.frame(a=seq(1,10,1), b=sample(1:15,10,replace=FALSE),prov=c(rep('QUE', 5), rep('BC', 5))), df2=

Re: [R] TreynorRatio

2012-11-09 Thread R. Michael Weylandt
On Fri, Nov 9, 2012 at 8:35 AM, sheen maria wrote: > Sir, > But in this price returns only the closing value (Cl(getsymbols("IBM")) > i already refer the ?TreynorRatio > > But it not specify how to calculate the benchmark return. > In this case what value i put as benchmark return series. > Ple

Re: [R] Error in memory.size(size) when calling R in batch mode (but not in interactive mode)

2012-11-09 Thread Franckx Laurent
Thank you for the hint. In batch mode, I got: R version 2.15.1 (2012-06-22) Platform: i386-pc-mingw32/i386 (32-bit) In interactive mode, I got: R version 2.15.1 (2012-06-22) Platform: x86_64-pc-mingw32/x64 (64-bit) And I have found the cause. In my path, I had still included C:\R-2.15.1\bin

Re: [R] if between 500-600 give 550

2012-11-09 Thread Rui Barradas
Hello, Try myframe$new <- NA myframe$new[300 <= myframe$Hunger & myframe$Hunger < 400] <- 350 myframe$new[400 <= myframe$Hunger & myframe$Hunger < 500] <- 450 myframe$new[500 <= myframe$Hunger & myframe$Hunger < 600] <- 550 myframe Why reduce the number of values? Hope this helps, Rui Barrada

Re: [R] Labeling position barchart

2012-11-09 Thread Sarah Goslee
You told us neither what you did, nor what was not as you expected. Nonetheless, try this example: x <- c(9, 5, 7) mybarplot <- barplot(x, ylim=c(0, 10)) text(mybarplot, x+.08, letters[1:3], pos=3) Sarah On Fri, Nov 9, 2012 at 6:33 AM, Geophagus wrote: > Hi @ all, > I try to set a labeling on

Re: [R] CCA with Vegan - Plot problem

2012-11-09 Thread Gavin Simpson
On Fri, 2012-11-09 at 05:16 -0800, rumble14 wrote: > Thanks for replying. Apologies for not putting the code, I have not deviated > from that used on the website I linked to. > > >Can you show the exact code you used please? > > I am using: > #below is Species_1 etc > org <- read.table ("Organis

Re: [R] Creating yyyymm regexp strings on the fly for aggregation.

2012-11-09 Thread Keith Weintraub
Thanks, I feel like I was so close!!! KW -- On Nov 9, 2012, at 4:48 AM, Rui Barradas wrote: > Hello, > > Something like this? > > > fun <- function(years, periods){ >res <- lapply(splitIt(1:12, periods), function(x) groupingStrings(years, > x)) >names(res) <- as.integer(names(re

Re: [R] Error in memory.size(size) when calling R in batch mode (but not in interactive mode)

2012-11-09 Thread Milan Bouchet-Valat
Le vendredi 09 novembre 2012 à 10:43 +, Franckx Laurent a écrit : > Dear all > > I use a 64 bit Windows7 system with 16 GB memory. > I have run an R script in batch mode with the following command: > R CMD BATCH masterassignment_2012_11_09.r --save > The execution was terminated with th

Re: [R] General function to substitute values in a data frame

2012-11-09 Thread arun
HI, May be this: res<- data.frame(apply(df,2,function(x) ifelse(grepl("\\d+",x),LETTERS[x-9],NA))) res #  y z #1 A S #2 B T #3 C U #4 D V #or  apply(df,2,function(x) LETTERS[x-9]) A.K. - Original Message - From: Fabricius Domingos To: r-help@r-project.org Cc: Sent: Friday, November

Re: [R] CCA with Vegan - Plot problem

2012-11-09 Thread rumble14
Thanks for replying. Apologies for not putting the code, I have not deviated from that used on the website I linked to. >Can you show the exact code you used please? I am using: #below is Species_1 etc org <- read.table ("Organisms.S", header=TRUE, row.names=1) #below is environmental variables

  1   2   >