Re: [R] Finding data association in R

2009-05-19 Thread phen_ys
Johannes Hüsing wrote: Am 19.05.2009 um 05:39 schrieb phen_ys: surgery - data.frame(outcome = c(0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, + 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0), age = c(50, 50, 51, + 51, 53, 54, 54, 54, 55, 55, 56, 56, 56,

Re: [R] Finding data association in R

2009-05-19 Thread Bill.Venables
Your problem is statistical and has nothing particularly to do with R. It looks like homework to me. You may care to look at it this way: ### fm - glm(outcome ~ age, binomial, surgery) summary(fm) Call: glm(formula = outcome ~ age, family = binomial, data = surgery)

Re: [R] Predicting complicated GAMMs on response scale

2009-05-19 Thread Gavin Simpson
On Mon, 2009-05-18 at 11:48 -0700, William Paterson wrote: Hi, I am using GAMMs to show a relationship of temperature differential over time with a model that looks like this:- gamm(Diff~s(DaysPT)+AirToC,method=REML) where DaysPT is time in days since injury and Diff is repeat measures

Re: [R] Overdispersion using repeated measures lmer

2009-05-19 Thread ONKELINX, Thierry
Dear Christine, The poisson family does not allow for overdispersion (nor underdispersion). Try using the quasipoisson family instead. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek /

[R] As mat.or.vec

2009-05-19 Thread Barbara . Rogo
is there a command like mat.or.vec for an array that I have to create with a cicle for? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Generic 'diff'

2009-05-19 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: On Mon, May 18, 2009 at 6:00 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: I understood what you were asking but R is an oo language so that's the model to use to do this sort of thing. I am not talking about creating a new class with an

Re: [R] fitting distribution

2009-05-19 Thread Stefan Grosse
On Tue, 19 May 2009 14:04:19 +1000 Kon Knafelman konk2...@hotmail.com wrote: KK i have the sample variances for 1000 samples, and i want to fit it KK to a chi-squared distribution. KK can someone please help me fit this to a chi-squared distribution KK with n degrees of freedom. Thanks a lot

Re: [R] Generic 'diff'

2009-05-19 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: Stavros Macrakis wrote: [...] I am not talking about creating a new class with an analogue to the subtraction function. I am talking about a function which applies another function to a sequence and its lagged version. Functional arguments are used all over

Re: [R] Overdispersion using repeated measures lmer

2009-05-19 Thread Christine Griffiths
Thanks. I did try using quasipoisson and a negative binomial error but am unsure of the degree of overdispersion and whether it is simply due to missing values. I am investigating to see if I can replace these missing values so that I can have a balanced orthogonal design and use lme or aov

[R] R copula - empirical distributions

2009-05-19 Thread matejp
Dear list, Has anyone used the 'copula' or 'fCopulae' package with empirical distributions. I have two distributions (10.000 samples each) which I need to combine using archimedean copulas (probably Clayton and/or Frank). Is this possible? Is there an existing empirical distribution function

Re: [R] Generic 'diff'

2009-05-19 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: btw., the error message here is confusing: lag = 1:2 diff(1:10, lag=lag) # Error in diff.default(1:10, lag = lag) : # 'lag' and 'differences' must be integers = 1 is.integer(lag) # TRUE all(lag = 1) # TRUE what is meant is

Re: [R] Wilcoxon nonparametric p-values

2009-05-19 Thread Peter Dalgaard
cvandy wrote: When I use wilcox.test, I get vastly different p-values than the problems from Statistics textbooks. For example: The following problem comes from Applied Statistics and Probability for Engineers, 2nd Edition, by D. C. Montgomery. Page736, problem 14.7. The problem is to compare

Re: [R] Wilcoxon nonparametric p-values

2009-05-19 Thread Keith Jewell
I just tried it in Minitab and got -- Test of median = 8.500 versus median not = 8.500 N for Wilcoxon Estimated N Test Statistic P Median C1 20 19 80.5 0.573 8.460 - One tailed gave me closer to the textbook, but still

Re: [R] Overdispersion using repeated measures lmer

2009-05-19 Thread ONKELINX, Thierry
Dear Christine, (Month|Block) and (1|Block) + (1|Month) are completely different random effects. The first assumes that each Block exhibits a different linear trend along Month. The latter assumes that each block has a random effect, each month has a random effect and that the random effects

[R] problem with installing a local zip file : GFCURE

2009-05-19 Thread marc bernard
Dear all, I am trying to install a package called GFCURE from a local zip file. This package fits a cure survival model and has been downloaded from: http://post.queensu.ca/~pengp/software.html The problem is that when I try to install this package from a local zip file using R,

[R] Coord_equal in ggplot2

2009-05-19 Thread ONKELINX, Thierry
Dear all, I'm plotting some points on a graph where both axes need to have the same scale. See the example below. Coord_equal does that trick but in this case it wastes a lot of space on the y-axis. Setting the limits of the y-axis myself was no avail. Any suggestions to solve this problem?

[R] remove empty objects from workspace

2009-05-19 Thread Katharina May
Hi, how can I remove all empty objects (which are NA or have zero rows) from my workspace? Thanks, Katharina __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Remove objects names like character String

2009-05-19 Thread Katharina May
Hi, how can I use rm() on objects named like: paste(site,i,_data,sep=) while looping through i? I tried rm(paste(site,i,_data,sep=)) but I get the error that rm() must contain names or text strings which is confusing me as I thought paste() would create something like that...? Thanks,

Re: [R] Coord_equal in ggplot2

2009-05-19 Thread Mike Lawrence
If you use coord_equal on data where the range on the x-axis is larger than the range on the y-axis, then of course you'll observe extra space on the y-axis. What did you expect? Also, this post may be better suited to the ggplot2 mailing list: http://had.co.nz/ggplot2/ On Tue, May 19, 2009 at

Re: [R] remove empty objects from workspace

2009-05-19 Thread Jim Lemon
Katharina May wrote: Hi, how can I remove all empty objects (which are NA or have zero rows) from my workspace? Hi Katharina, To remove objects that are all NA: for(object in objects()) if(all(is.na(get(object rm(list=object) If by zero rows you mean objects that do not have a

Re: [R] remove empty objects from workspace

2009-05-19 Thread Katharina May
Thanks Jim, the removal of objects which are NA works perfectly! For my second problem it didn't express myself correctly: I actually meant objects with rows (attributes?) but no data in it but I solved this adjusting your approach: for(object in objects()) if(is.null(dim(get(object))[1]) ||

[R] loglinear analysis

2009-05-19 Thread Zoltan Kmetty
Dear R Users, A would like to fit a loglinear analysis to a three dimensional contingency table. But I Don't want to run a full saturated modell. Is there any package in R that could handle somekind of stepwise search to choose out the best soultion? And how can I fit a non fully saturated

Re: [R] loglinear analysis

2009-05-19 Thread Steve_Friedman
Look to the glm function then pass the output to the step function Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147

Re: [R] problem with installing a local zip file : GFCURE

2009-05-19 Thread Prof Brian Ripley
On Tue, 19 May 2009, marc bernard wrote: Dear all, I am trying to install a package called GFCURE from a local zip file. This package fits a cure survival model and has been downloaded from: http://post.queensu.ca/~pengp/software.html However, it is not an R package. Read the

Re: [R] Generic 'diff'

2009-05-19 Thread Gabor Grothendieck
Note that this could be done like this for ordinary vectors: x - seq(1:4)^2 apply(embed(x, 2), 1, function(x, f) f(rev(x)), f = diff) [1] 3 5 7 apply(embed(x, 2), 1, function(x, f) f(rev(x)), f = sum) [1] 5 13 25 or a method to rollapply in zoo could be added for ordinary vectors. Here it

Re: [R] remove empty objects from workspace

2009-05-19 Thread Henrique Dallazuanna
Try this also: rm(list=names(which(unlist(eapply(globalenv(), function(a)all(is.na(a) || is.null(a))) On Tue, May 19, 2009 at 9:07 AM, Katharina May may.kathar...@googlemail.com wrote: Thanks Jim, the removal of objects which are NA works perfectly! For my second problem it didn't

Re: [R] problem with installing a local zip file : GFCURE

2009-05-19 Thread Gabor Grothendieck
On Tue, May 19, 2009 at 6:17 AM, marc bernard marc_bern...@hotmail.co.uk wrote: Dear all, I am trying to install a package called GFCURE from a local zip file. This package fits a cure survival model and  has been downloaded from: You are assuming its in the form of an R *package* but

[R] memory stack overflow

2009-05-19 Thread Nora Pérez
Dear colleagues, I am trying a glm.nb for the distribution of a plant species with 93 environmental variables. I execute the instruction and I get the following message: Error: C stack usage is too close to the limit. How can I increase the memory of R? Your sincerely, Nora.

Re: [R] memory stack overflow

2009-05-19 Thread ivan valencia
Have you try principal component analysis to reduce space variables? 2009/5/19 Nora Pérez norichu...@hotmail.com Dear colleagues, I am trying a glm.nb for the distribution of a plant species with 93 environmental variables. I execute the instruction and I get the following message:

Re: [R] Remove objects names like character String

2009-05-19 Thread Uwe Ligges
Katharina May wrote: Hi, how can I use rm() on objects named like: paste(site,i,_data,sep=) while looping through i? I tried rm(paste(site,i,_data,sep=)) but I get the error that rm() must contain names or text strings which is confusing me as I thought paste() would create something like

Re: [R] stringsAsFactors param in expand.grid not working

2009-05-19 Thread Martin Maechler
RT == Rolf Turner r.tur...@auckland.ac.nz on Tue, 19 May 2009 11:02:08 +1200 writes: RT On 19/05/2009, at 10:20 AM, Steve Lianoglou wrote: Hi all, I've (tried) to look through the bug tracker, and gmane-search the R list to see if this has been mentioned

Re: [R] problem with installing a local zip file : GFCURE

2009-05-19 Thread marc bernard
Dear gabor, Many thanks for your answer. I indeed didn't check the read me text. Bests From: ggrothendi...@gmail.com Date: Tue, 19 May 2009 08:44:13 -0400 Subject: Re: [R] problem with installing a local zip file : GFCURE To: marc_bern...@hotmail.co.uk CC: r-help@r-project.org

Re: [R] Coord_equal in ggplot2

2009-05-19 Thread Dieter Menne
ONKELINX, Thierry Thierry.ONKELINX at inbo.be writes: I'm plotting some points on a graph where both axes need to have the same scale. See the example below. Coord_equal does that trick but in this case it wastes a lot of space on the y-axis. Setting the limits of the y-axis myself was no

Re: [R] Wilcoxon nonparametric p-values

2009-05-19 Thread Charles Van deZande
Thanks Peter, There are 8 measurements less than 8.5, so calculating the probability (binomial) of 8, or fewer, happening by chance with n = 20 and p = 0.50 gives P = 0.25-- the book answer. I've tried several problems in other textbooks and in each case I get vastly different P-values than I

Re: [R] how to calculate means of matrix elements

2009-05-19 Thread dxc13
Easy enough. What if some of the matrix elements contained missing values? Then how could you still calculate the means? Example code below: mat1 - matrix(c(1,2,3,4,5,NA,7,8,9),3,3) mat2 - matrix(c(NA,6,1,9,0,5,8,2,7),3,3) mat3 - matrix(c(5,9,1,8,NA,3,7,2,4),3,3) Gabor Grothendieck wrote:

Re: [R] Wilcoxon nonparametric p-values

2009-05-19 Thread Peter Dalgaard
Charles Van deZande wrote: Thanks Peter, There are 8 measurements less than 8.5, so calculating the probability (binomial) of 8, or fewer, happening by chance with n = 20 and p = 0.50 gives P = 0.25-- the book answer. I've tried several problems in other textbooks and in each case I get

Re: [R] Remove objects names like character String

2009-05-19 Thread Henrique Dallazuanna
Try this: rm(list=ls(patt=site[0-9]$)) On Tue, May 19, 2009 at 7:47 AM, Katharina May may.kathar...@googlemail.com wrote: Hi, how can I use rm() on objects named like: paste(site,i,_data,sep=) while looping through i? I tried rm(paste(site,i,_data,sep=)) but I get the error that rm()

Re: [R] memory stack overflow

2009-05-19 Thread Prof Brian Ripley
That is very unusual, but the C stack can be increased under Windows by recompiling R (see src/gnuwin32/front-ends/Makefile). On most other OSes it is much easier, just adjust the setting via ulimit or limit in your shell. But I suspect the problem is that your model is too complex.

Re: [R] Remove objects names like character String

2009-05-19 Thread Katharina May
thanks to all your solutions, works out perfectly! 2009/5/19 Henrique Dallazuanna www...@gmail.com: Try this: rm(list=ls(patt=site[0-9]$)) On Tue, May 19, 2009 at 7:47 AM, Katharina May may.kathar...@googlemail.com wrote: Hi, how can I use rm() on objects named like:

Re: [R] Remove objects names like character String

2009-05-19 Thread Ronggui Huang
I don't get the error you mention: site1_data-1 site2_data-2 site3_data-3 for (i in 1:3) paste(site,i,_data,sep=) In my example, another way is: rm(list=paste(site,1:3,_data,sep=)) Or you can use rm(list=ls(pattern=you pattern)), in my example, it is: rm(list=ls(pattern=site[1-3]_data))

[R] error glmpath()

2009-05-19 Thread David A.G
Hi R-users! I am trying to learn how to use the glmpath package. I have a dataframe like this dim(data) [1] 605 109 and selected the following response - data[,1] features-as.matrix(data[,3:109]) mymodel - glmpath(features,response, family = binomial) Error in if (lambda = min.lambda) {

[R] nlrwr package. Error when fitting the optimal Box-Cox transformation with two variables

2009-05-19 Thread Ikerne del Valle
Dear all: I'm trying to fit the optimal Box-Cox transformation related to nls (see the code below) for the demand of money data in Green (3th Edition) but in the last step R gives the next error message. Error en `[.data.frame`(eval(object$data), ,

[R] Spearman rho

2009-05-19 Thread mauede
I read that Spearman rho can be used to detect the presence of trend in a time series. However, I cannot figure out how to use such a test to thsi purpose. First of all which one of the available functions and how to pass my mono-channel time series which contains both positive and negative

[R] File too big for filehash?

2009-05-19 Thread Rocko22
Dear R users, I try to use a very large file (~3 Gib) with the filehash package. The length of the dataset is around 4,000,000 obs. I get this message from R while trying to load the dataset (named cc084.csv): dumpDF(read.csv(cc084.csv, header=T), dbName=db01) Erreur : impossible d'allouer un

[R] Using while statements to insert rows in a dataframe

2009-05-19 Thread Eric McKibben
Hi. I am very new to R and have been diligently working my way through the manual and various tutorials. I am now trying to work with some of my own data and have encountered a problem that I need to fix. I have a dataframe with 8 columns and approximately 850 rows. I have provided an

Re: [R] Using while statements to insert rows in a dataframe

2009-05-19 Thread Dieter Menne
Eric McKibben wrote: Within column 6 (Question) the numbers 1:33 repeat down the entire column. Occasionally, however, another value (-32767) appears. I need to locate this value everytime it appears and in its place insert 33 rows that are numbered 1:33 in column Question.

Re: [R] Using while statements to insert rows in a dataframe

2009-05-19 Thread Luc Villandre
Eric McKibben wrote: Hi. I am very new to R and have been diligently working my way through the manual and various tutorials. I am now trying to work with some of my own data and have encountered a problem that I need to fix. I have a dataframe with 8 columns and approximately 850 rows. I

[R] exists function on list objects gives always a FALSE

2009-05-19 Thread Žroutík
Dear R-users, in a minimal example exists() gives FALSE on an object which obviously does exist. How can I check on that list object anyway else, please? SmoothData - list(exists=TRUE, span=0.001) SmoothData $exists [1] TRUE $span [1] 0.001 exists(SmoothData) TRUE exists(SmoothData$span)

[R] create string of comma-separated content of vector

2009-05-19 Thread Katharina May
Hi, how do I create a string of the comma-separated content of a vector? I've got the vector i with several numeric values as content: str(i) num 99 and want to create a SQL statement to look like the following where the part '(2, 4, 6, 7)' should be the content of the vector i: select * from

Re: [R] exists function on list objects gives always a FALSE

2009-05-19 Thread Linlin Yan
SmoothData$span is not an object which can be checked by exists(), but part of an object which can be checked by is.null(). On Wed, May 20, 2009 at 12:07 AM, Žroutík zrou...@gmail.com wrote: Dear R-users, in a minimal example exists() gives FALSE on an object which obviously does exist. How

Re: [R] exists function on list objects gives always a FALSE

2009-05-19 Thread Duncan Murdoch
On 5/19/2009 12:07 PM, Žroutík wrote: Dear R-users, in a minimal example exists() gives FALSE on an object which obviously does exist. How can I check on that list object anyway else, please? SmoothData - list(exists=TRUE, span=0.001) SmoothData $exists [1] TRUE $span [1] 0.001

Re: [R] exists function on list objects gives always a FALSE

2009-05-19 Thread Romain Francois
Žroutík wrote: Dear R-users, in a minimal example exists() gives FALSE on an object which obviously does exist. How can I check on that list object anyway else, please? SmoothData - list(exists=TRUE, span=0.001) SmoothData $exists [1] TRUE $span [1] 0.001 exists(SmoothData)

Re: [R] exists function on list objects gives always a FALSE

2009-05-19 Thread Wacek Kusnierczyk
Žroutík wrote: SmoothData - list(exists=TRUE, span=0.001) SmoothData $exists [1] TRUE $span [1] 0.001 exists(SmoothData) TRUE exists(SmoothData$span) FALSE 'SmoothData$span' = 'foo' exists(SmoothData$span) # TRUE exists(SmoothData[[2]])

Re: [R] Coord_equal in ggplot2

2009-05-19 Thread ONKELINX, Thierry
Dear Dieter, I tried that. But it rescales one of the axis. The resulting graph is still square. But now 1 cm Y-axis equal 2.5 cm on the X-axis. This seems not te be the documented behaviour. ggplot(ds, aes(x = x, y = y)) + geom_point() + coord_equal(ratio = 2/5) From sessionInfo() R 2.9.0

Re: [R] exists function on list objects gives always a FALSE

2009-05-19 Thread Wacek Kusnierczyk
Linlin Yan wrote: SmoothData$span is not an object which can be checked by exists(), but part of an object which can be checked by is.null(). is.null is unhelpful here, in that lists can contain NULL as a named element, and retrieving a non-existent element returns NULL: foo =

Re: [R] Wilcoxon nonparametric p-values

2009-05-19 Thread Charles Van deZande
Thanks Peter, You are correct! After I sent the previous message, I realized that I was comparing the sign test against the Wilcoxon test. I would have replied sooner, but I realized that while I was out walking my dogs. CHV   Charles H Van deZande ---Original Message--- From:

Re: [R] anova(cph(..) output

2009-05-19 Thread pompon
Hi, Thank you very much for the answer. However, I have still some misunderstandings. from the output, can we say that plant and leaf age are significant but not their interaction? And the last question I promise, what would you advise me to write in the paper to explain the different method

Re: [R] text() to label points in ggplot

2009-05-19 Thread Sunil Suchindran
# Here are two options: p - ggplot(mtcars, aes(wt, mpg)) + geom_point() + geom_text(aes(x = 5, y = 30, label = A Label)) #or response - c(2,4) xvar - c(1,2) label - response; myData - data.frame(response,xvar,label) p - ggplot(myData, aes(y=response, x=xvar)) p + geom_bar(position=dodge,

Re: [R] create string of comma-separated content of vector

2009-05-19 Thread Mark Wardle
see ?paste e.g. x - seq(0,10,1) paste(x, collapse=, ) 2009/5/19 Katharina May may.kathar...@googlemail.com: Hi, how do I create a string of the comma-separated content of a vector? I've got the vector i with several numeric values as content: str(i) num 99 and want to create a SQL

Re: [R] anova(cph(..) output

2009-05-19 Thread Frank E Harrell Jr
pompon wrote: Hi, Thank you very much for the answer. However, I have still some misunderstandings. from the output, can we say that plant and leaf age are significant but not their interaction? And the last question I promise, what would you advise me to write in the paper to explain the

[R] length(grep(...

2009-05-19 Thread Dennis Fisher
Colleagues R2.8.1 in OSX I often combine two commands as follows: length(grep(TEXT, OBJECT)) 0 to see if a particular snippet of text exists within an object. Is there a single command that would accomplish this? Dennis Dennis Fisher MD P (The P Less Than Company) Phone:

Re: [R] length(grep(...

2009-05-19 Thread Romain Francois
Hi, R=2.9.0 ships grepl, which lets you do that: any( grepl( TEXT, OBJECT) ) You can also: install.packages( operators ) require( operators ) OBJECT %~+% TEXT Romain Dennis Fisher wrote: Colleagues R2.8.1 in OSX I often combine two commands as follows: length(grep(TEXT, OBJECT)) 0

[R] S data sets in R?

2009-05-19 Thread Michael Hannon
Greetings. I'm trying to learn to program in R. (I'm definitely NOT new to programming, just to R.) A colleague suggested that I have a look at the book: An Introduction to S and S-Plus by: Phil Spector I've glanced at the book, and it does indeed seem to be the kind of thing I

Re: [R] S data sets in R?

2009-05-19 Thread Chu, Roy
Maybe you should just bypass that book for one of these? http://www.springer.com/series/6991 -Ro On Tue, May 19, 2009 at 12:01 PM, Michael Hannon jm_han...@yahoo.com wrote: Greetings.  I'm trying to learn to program in R.  (I'm definitely NOT new to programming, just to R.)  A colleague

Re: [R] exists function on list objects gives always a FALSE

2009-05-19 Thread Stavros Macrakis
On Tue, May 19, 2009 at 12:07 PM, Žroutík zrou...@gmail.com wrote: SmoothData - list(exists=TRUE, span=0.001) exists(SmoothData$span) FALSE As others have said, this just checks for the existence of a variable with the (strange) name SmoothData$span. In some sense, in R semantics, xxx$yyy

Re: [R] exists function on list objects gives always a FALSE

2009-05-19 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: You might think that you can check names(xxx) to see if the slot has been explicitly set, but it depends on *how* you have explicitly set the slot to NULL: xxx$hello - 3 xxx$hello - NULL names(xxx) character(0) # no names --

[R] Replace / swap values of subset of a data.frame

2009-05-19 Thread tsunhin wong
Dear R users, I have 1 data.frame of 1500x80 - data1. I found out that there are a few cells of data that I have misplace, and I need to fix the ordering of them. In an attempt trying to swap column 22 23 of the Subject with misplaced data, I did the following: data2 - data1

[R] help with error

2009-05-19 Thread deanj2k
while (theta1!=theta) {...} gives the error message: Error in while (theta1 != theta) { : missing value where TRUE/FALSE needed but when i extract theta1!=theta and paste it into the console it comes up with the output TRUE which contradicts the error message- im not sure what I am doing

[R] what is wrong with this code?

2009-05-19 Thread deanj2k
dlogl - -(n/theta)-sum((y/(theta)^2)*((1-exp(y/theta))/(1+exp(y/theta))) d2logl - (n/theta^2) - sum((-2y/theta^3)*(1-exp(y/theta))/(1+exp(y/theta))) - sum(((2*y/theta^4)*exp(y/theta))/((1+exp(y/theta))^2)) returns the error message: Error: unexpected symbol in: dlogl -

Re: [R] (no subject)

2009-05-19 Thread Douglas Bates
On Mon, May 18, 2009 at 9:22 AM, Thomas Lumley tlum...@u.washington.edu wrote: On Mon, 18 May 2009, Debbie Zhang wrote: Based on a set of binomial sample data, how would you utilize the nlm function in R to estimate the true proportion of the population? I can't see why anyone would want to

Re: [R] what is wrong with this code?

2009-05-19 Thread Sundar Dorai-Raj
You're missing a ) off end of the first line. You should consider using an editor (e.g. ESS/Emacs) that does parentheses matching. I found this in less than 5 sec (less time than I'm taking to write you a note) by cut and pasting in Emacs. --sundar On Tue, May 19, 2009 at 12:52 PM, deanj2k

Re: [R] what is wrong with this code?

2009-05-19 Thread Ted Harding
On 19-May-09 19:52:20, deanj2k wrote: dlogl - -(n/theta)-sum((y/(theta)^2)*((1-exp(y/theta))/(1+exp(y/theta))) d2logl - (n/theta^2) - sum((-2y/theta^3)*(1-exp(y/theta))/(1+exp(y/theta))) - sum(((2*y/theta^4)*exp(y/theta))/((1+exp(y/theta))^2)) returns the error message: Error:

Re: [R] S data sets in R?

2009-05-19 Thread Douglas Bates
On Tue, May 19, 2009 at 2:01 PM, Michael Hannon jm_han...@yahoo.com wrote: Greetings.  I'm trying to learn to program in R.  (I'm definitely NOT new to programming, just to R.)  A colleague suggested that I have a look at the book:    An Introduction to S and S-Plus by:    Phil Spector

Re: [R] binom package (was: no subject)

2009-05-19 Thread spencerg
There are 17 different help pages in 5 different packages citing Agresti and Coull. This is quickly displayed using the RSiteSearch package as follows: library(RSiteSearch) HTML(RSiteSearch.function(Agresti and Coull)) I have not checked all these 17, but they doubtless help

Re: [R] S data sets in R?

2009-05-19 Thread spencerg
My favorite tool for finding things like this is RSiteSearch.function in the RSiteSearch package. For the objects you mention, I get the following: library(RSiteSearch) hits(a.s - RSiteSearch.function(auto.stats)) # 0 hits(sx - RSiteSearch.function(saving.x)) # 0 hits(rn -

[R] Getting lm() to work with a matrix

2009-05-19 Thread MikSmith
Hi I'm fairly new to R and am trying to analyse some large spectral datasets using stepwise regression (fairly standard in this area). I have a field sampled dataset, of which a proportion has been held back for validation. I gather than step() needs to be fed a regression model and lm() can

[R] panel question (plm)

2009-05-19 Thread Stephen J. Barr
Hello, I am working on a data set (already as a plm.data object) located here: http://econsteve.com/arch/plmWithDensity.Robj With the following R session: library(plm) ... load(plmWithDensity.Robj) model - plm(RATE ~ density08, data=plmWithDensity) Error: subscript out of bounds I am not

Re: [R] panel question (plm)

2009-05-19 Thread Achim Zeileis
On Tue, 19 May 2009, Stephen J. Barr wrote: Hello, I am working on a data set (already as a plm.data object) located here: http://econsteve.com/arch/plmWithDensity.Robj With the following R session: library(plm) ... load(plmWithDensity.Robj) model - plm(RATE ~ density08,

[R] create string of comma-separated content of vector

2009-05-19 Thread Law, Jason
See ?toString x - 0:10 toString(x) See ?sQuote for cases where the vector is a character and needs to be quoted. Jason Law Statistician City of Portland Bureau of Environmental Services Water Pollution Control Laboratory 6543 N Burlington Avenue Portland, OR 97203-5452

Re: [R] panel question (plm)

2009-05-19 Thread Stephen J. Barr
Ah, thank you for the help, and for the explanation of what is going on. I suppose I will have to reload my data with plm.data set such that RATE is not a factor. For my time index, will 2000,2000.25,2000.5, etc. work? Meaning 2000 quarter 1, 2000 quarter 2, etc? Or is there some special way that

Re: [R] Barchart in lattice - wrong order of groups, data labels on top of each other, and a legend question

2009-05-19 Thread Deepayan Sarkar
On Mon, May 18, 2009 at 11:47 AM, Dimitri Liakhovitski ld7...@gmail.com wrote: Hello! I have a question about my lattice barchart that I am trying to build in Section 3 below. I can't figure out a couple of things: 1. When I look at the dataframe test that I am trying to plot, it looks right

Re: [R] panel question (plm)

2009-05-19 Thread Achim Zeileis
On Tue, 19 May 2009, Stephen J. Barr wrote: Ah, thank you for the help, and for the explanation of what is going on. I suppose I will have to reload my data with plm.data set such that RATE is not a factor. plmWithDensity$RATE - as.numeric(as.character(plmWithDensity$RATE)) should suffice.

Re: [R] Getting lm() to work with a matrix

2009-05-19 Thread Gabor Grothendieck
Try this (note dot after ~): lm(response[, 3] ~., as.data.frame(spectra.spec[, 2:20])) On Tue, May 19, 2009 at 6:21 PM, MikSmith m...@hsm.org.uk wrote: Hi I'm fairly new to R and am trying to analyse some large spectral datasets using stepwise regression (fairly standard in this area). I

[R] [R-pkgs] New version of actuar

2009-05-19 Thread Vincent Goulet
Dear useRs, A new version of actuar is available since last Friday. This is mainly a bugfix release. From the NEWS file: Version 1.0-2 = USER-VISIBLE CHANGES o mfoo() and levfoo() now return Inf instead of NaN for infinite moments. (Thanks to David Humke for the idea.) BUG

Re: [R] panel question (plm)

2009-05-19 Thread Stephen J. Barr
Thank you for the advice. For the density08 variable, that is population density in year 2008. I also have population densities for year 2000, so I could put them both in, and interpolate between them for the times that are covered by the panel (2000-2008), and then just have a density column that

[R] how to copy files from one direction to another?

2009-05-19 Thread XinMeng
There's 10 files in c:\\ I wanna copy 3 of them to d:\\ How to do it via R? Thanks! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

Re: [R] how to copy files from one direction to another?

2009-05-19 Thread jim holtman
?file.copy On Tue, May 19, 2009 at 9:51 PM, XinMeng xm...@capitalbio.com wrote: There's 10 files in c:\\ I wanna copy 3 of them to d:\\ How to do it via R? Thanks! __ R-help@r-project.org mailing list

Re: [R] Replace / swap values of subset of a data.frame

2009-05-19 Thread jim holtman
Exactly what are you trying to do? Are you trying to just change a subset of the values? 'subset' does not have an 'assignment' operator. Maybe you want something like this (but it is not clear from your description. Also it is not clear if you have exactly the same set of matching values in

Re: [R] Replace / swap values of subset of a data.frame

2009-05-19 Thread Gabor Grothendieck
If DF is your data frame: DF2 - edit(DF) and then make the changes manually in the spreadsheet that pops up. On Tue, May 19, 2009 at 3:50 PM, tsunhin wong thjw...@gmail.com wrote: Dear R users, I have 1 data.frame of 1500x80 - data1. I found out that there are a few cells of data that I

[R] Too large a data set to be handled by R?

2009-05-19 Thread tsunhin wong
Dear R users, I have been using a dynamic data extraction from raw files strategy at the moment, but it takes a long long time. In order to save time, I am planning to generate a data set of size 1500 x 2 with each data point a 9-digit decimal number, in order to save my time. I know R is

[R] Extracting correlation in a nlme model

2009-05-19 Thread Kenneth Roy Cabrera Torres
Hi R users: Is there a function to obtain the correlation within groups from this very simple lme model? modeloMx1 Linear mixed-effects model fit by REML Data: barrag Log-restricted-likelihood: -70.92739 Fixed: fza_tension ~ 1 (Intercept) 90.86667 Random effects: Formula: ~1 |

[R] glht problem

2009-05-19 Thread Stats Wolf
I am struggling with a simple repeated-measure model: fit-lme(trait~year * A, random = ~1|subj/year) A being a factor with three levels. I got have the following results for anova(fit): numDF denDF F-value p-value (Intercept) 1 126 2471.4720 .0001 year 2060

[R] Package Inline under windows

2009-05-19 Thread _
Hi all, I installed the package inline (windows-version) but can not compile any code, I alway get an error message ERROR(s) during compilation : source code errors or compiler configuration errors! Unfornutanely there is no description where the package finds a c-compiler nor where so set