Re: [R] Replace columns in a data.frame randomly splitted

2011-12-01 Thread agent dunham
The thing is that I've already been working with df1, and I was looking for a function that could replace values knowing rows and columns. Does it exist? Thank you, u...@host.com -- View this message in context:

Re: [R] Error adding Bigmemory package

2011-12-01 Thread Uwe Ligges
On 30.11.2011 21:53, RogerP wrote: I am trying to add the bigmemory packages but I get the following error message: In file included from bigmemory.cpp:14:0: ../inst/include/bigmemory/isna.hpp: In function 'bool neginf(double)': ../inst/include/bigmemory/isna.hpp:22:57: error: 'isinf' was not

[R] References for book R In Action by Kabacoff

2011-12-01 Thread Ravi Kulkarni
I know this is not really an R question - it is a query about a recent book on R (R In Action) by Robert Kabacoff, (Manning Publications 2011). There are many references to interesting topics in R in the book, BUT, I do not find a bibliography/list of references in the book! Does anybody know if

Re: [R] References for book R In Action by Kabacoff

2011-12-01 Thread Uwe Ligges
On 01.12.2011 10:10, Ravi Kulkarni wrote: I know this is not really an R question - it is a query about a recent book on R (R In Action) by Robert Kabacoff, (Manning Publications 2011). There are many references to interesting topics in R in the book, BUT, I do not find a bibliography/list of

[R] Odp: R code

2011-12-01 Thread Petr PIKAL
Hi Hi everybody, I am unable to resolve this error using the following for loop. Would appreciate help. The same loop works with for(i in 1:92) strangely. I checked the .raw input file and everything is kosher, even Line 547 mentioned in the error message. I wonder if there is any

Re: [R] how big (in RAM and/or disk storage) is each of these objects in a list?

2011-12-01 Thread Uwe Ligges
On 26.11.2011 20:36, John wrote: On Sat, 26 Nov 2011 12:41:08 -0600 Paul Johnsonpauljoh...@gmail.com wrote: Greetings, friends (and others :) ) We generated a bunch of results and saved them in an RData file. We can open, use, all is well, except that the size of the saved file is quite a

Re: [R] R code

2011-12-01 Thread Jim Holtman
the problem might be a missing quote. Try quote = '' Or it might be a comment character, so try comment.char = '' This happens a lot if your data is not clean Sent from my iPad On Nov 30, 2011, at 19:48, nsaraf nsa...@gmail.com wrote: ) __

Re: [R] Drawing ticks in the 3rd and 4th row of a lattice

2011-12-01 Thread Ashim Kapoor
Dear Mr Sarkar, My apologies for not being articulate enough. Your solution worked perfectly. Many thanks, Ashim On Tue, Nov 22, 2011 at 9:12 PM, Deepayan Sarkar deepayan.sar...@gmail.comwrote: On Fri, Nov 18, 2011 at 11:22 AM, Ashim Kapoor ashimkap...@gmail.com wrote: Dear all, I want

Re: [R] Non-finite finite-difference value error in eha's aftreg

2011-12-01 Thread Milan Bouchet-Valat
Le mercredi 30 novembre 2011 à 18:41 +0100, Göran Broström a écrit : On Wed, Nov 16, 2011 at 3:06 PM, Milan Bouchet-Valat nalimi...@club.fr wrote: Hi list! I'm getting an error message when trying to fit an accelerated failure time

Re: [R] x, y for point of intersection

2011-12-01 Thread Hans W Borchers
Monica has sent me some data and code for taking a quick look. As it turned out, there was a simple programming error on her side. The segm_distance() function in package 'pracma' is working correctly. And there is no minimization procedure in here, it simply solves some equations from plane

Re: [R] SPSS - R

2011-12-01 Thread Yvonnick Noel
Dear Kristi, Also. can anyone recommend any resources to help SPSS users learn to things in R? You may want to have a look at the R2STATS package, a simple GUI for linear models. Best, Yvonnick Noel University of Brittany Department of Psychology Rennes, France

[R] permutate elements in a vector

2011-12-01 Thread Wendy
Hi all, I have a vector, e.g., A = c(10, 20, 30, 40). This 4 numbers have 4! = 24 different combination. I want to generate a matrix with one combination in one row, so the output would be B = 10 20 30 40 10 40 20 30 ... Does anyone know how to do this easily in R? Thank you very much.

[R] Raster manipulation in R

2011-12-01 Thread jjcabrera20
Hello everyone in the forum For introducing myself I would say I have a basic knowledge of R. Now I am intended to implement a flood algorithm using R. I have some MatLab experience doing these, and as an example to explain more or less what I want, I have a m code to calculate the slope from a

[R] combining arima and ar function

2011-12-01 Thread Samir Benzerfa
Hi everyone I've got a problem regarding the arima() and the ar() function for autoregressive series. I would simply like to combine them. To better understand my question, I first show you how I'm using these two functions individually (see file in the attachement). 1)

[R] Resampling with replacement on a binary (0, 1) dataset to get Cis

2011-12-01 Thread lincoln
...is it possible to do that? I apologize for something that must be a very trivial question for most of you but, unfortunately, it is not for me. A binary variable is measured, say, 50 times each year during 10 year. My interest is focused on the percentage of 1s with respect to the total if

Re: [R] R endnote entry

2011-12-01 Thread hwright
1. May I suggest that you try Mendeley for bibliographic management 2. There are also citations for specific R packages when you download each version. Let's use the ade4 package as an example: http://cran.r-project.org/web/packages/ade4/index.html if you selection citation info the corresponding

[R] efficient ways to dynamically grow a dataframe

2011-12-01 Thread Matteo Richiardi
Hi, I'm trying to write a small microsimulation in R: that is, I have a dataframe with info on N individuals for the base-year and I have to grow it dynamically for T periods: df = data.frame( id = 1:N, x = ) The most straightforward way to solve the problem that came to my mind is to

Re: [R] I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?

2011-12-01 Thread Edwin
Dear Gavin, Thanks a lot for your reply. I am still not sure if your suggestion can help me or not because I have got different types of errors while trying it. I have tried my best to troubleshoot them and made some progress, but I have reached a dead end (I don’t know how to go on). Below I am

Re: [R] Bayesian Quantile regression installation

2011-12-01 Thread Sarah Goslee
Please send your questions to the R-help list, and not directly to me. You provide your OS this time, but not any of the other information requested in the posting guide, like your version of R. What you did would be nice too. Used the menu option? Or used install.packages() at the command line?

[R] nipals in the chemometrics package in R

2011-12-01 Thread zz dd
Hello i need some precision about nipals in the chemometrics package in R . When i use nipals in chemometrics i obtain T and P matrix. I really don't understand what to do with these two matrix to obtain the scores for every the component (like in spss fo example) Comp1Comp2

[R] How to speed up int2bin conversion?

2011-12-01 Thread Jonas Jägermeyr
Dear R-help members, I'm processing a large amount of MODIS data where quality assessment information is stored as an integer value for each pixel. I have to converted this number to an 8 digit binary flag to get access to the stored quality code (e.g. in2bin(165,8) = 1 0 1 0 0 1 0 1).

Re: [R] FIML with missing data in sem package

2011-12-01 Thread John Fox
Dear Dustin, -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Dustin Fife Sent: November-30-11 9:51 PM To: r-help@r-project.org Subject: [R] FIML with missing data in sem package Is there a way to use full information

[R] bigmemory on Solaris

2011-12-01 Thread Jay Emerson
At one point we might have gotten something working (older version?) on Solaris x86, but were never successful on Solaris sparc that I remember -- it isn't a platform we can test and support. We believe there are problems with BOOST library compatibilities. We'll try (again) to clear up the

Re: [R] permutate elements in a vector

2011-12-01 Thread Berend Hasselman
Wendy wrote Hi all, I have a vector, e.g., A = c(10, 20, 30, 40). This 4 numbers have 4! = 24 different combination. I want to generate a matrix with one combination in one row, so the output would be B = 10 20 30 40 10 40 20 30 ... Does anyone know how to do this easily in

[R] how to get inflection point in binomial glm

2011-12-01 Thread René Mayer
Dear All, I have a binomial response with one continuous predictor (d) and one factor (g) (8 levels dummy-coded). glm(resp~d*g, data, family=binomial) Y=b0+b1*X1+b2*X2 ... b7*X7 how can I get the inflection point per group, e.g., P(d)=.5 I would be grateful for any help. Thanks in

Re: [R] Raster manipulation in R

2011-12-01 Thread Jean V Adams
jjcabrera20 wrote on 12/01/2011 04:02:47 AM: Hello everyone in the forum For introducing myself I would say I have a basic knowledge of R. Now I am intended to implement a flood algorithm using R. I have some MatLab experience doing these, and as an example to explain more or less what I

Re: [R] simplify source code

2011-12-01 Thread Christof Kluß
Hi now I'd like to do for (colname in c('ColName1','ColName2','ColName3')) { dat - measurements$colname But that does not work, though I can write measurements$C1 (same as measurements$C1) (but different to measurements[C1]!) Can you give me a hint? greetings Christof Am

Re: [R] Resampling with replacement on a binary (0, 1) dataset to get Cis

2011-12-01 Thread David Winsemius
On Dec 1, 2011, at 6:34 AM, lincoln wrote: ...is it possible to do that? I apologize for something that must be a very trivial question for most of you but, unfortunately, it is not for me. A binary variable is measured, say, 50 times each year during 10 year. My interest is focused on

Re: [R] permutate elements in a vector

2011-12-01 Thread Jean V Adams
Wendy wrote on 12/01/2011 04:27:09 AM: Hi all, I have a vector, e.g., A = c(10, 20, 30, 40). This 4 numbers have 4! = 24 different combination. I want to generate a matrix with one combination in one row, so the output would be B = 10 20 30 40 10 40 20 30 ... Does anyone

Re: [R] How to speed up int2bin conversion?

2011-12-01 Thread jim holtman
If we assume that you are just convert 8 bits, here is one way with a table lookup. If more than 8 bits, just partition the data and repeat. This sets up a mapping table one time for the lookup. Does 1M in 0.3 seconds on my computer; is this fast enough? # initialize a matrix with 8 bit

Re: [R] Problem installing the package tkrplot

2011-12-01 Thread Marcos Amaris Gonzalez
Thanks Peter. I was knowing that R had not found the header tk.h file. But i did not where it was. I opened my Manage Packages Synaptic and installed tk-dev and other similar packages, and voila! It work. I coul install tkrplot and the other packages that i was needing. THANKS, for your answer,

Re: [R] FIML with missing data in sem package

2011-12-01 Thread Rick Bilonick
On 12/01/2011 07:18 AM, John Fox wrote: To:r-help@r-project.org Subject: [R] FIML with missing data in sem package You should check out the OpenMx R package. Just search for OpenMx and SEM. You can download from the web site. It does FIML and is an excellent SEM package. Rick B .

Re: [R] simplify source code

2011-12-01 Thread jim holtman
measurements[[colname]] ?'[[' On Thu, Dec 1, 2011 at 8:34 AM, Christof Kluß ckl...@email.uni-kiel.de wrote: Hi now I'd like to do for (colname in c('ColName1','ColName2','ColName3')) {    dat - measurements$colname But that does not work, though I can write measurements$C1 (same as

[R] hi all.regarding quantile regression results..

2011-12-01 Thread narendarreddy kalam
i know this is not about R. After applying quantile regression with t=0.5,0.6 on the data set WBC( Wisconsin Breast Cancer)with 678 observations and 9 independent variables(inp1,inp2,...inp9) and 1 dependent variable(op) i have got the following results for beta values. when t=0.5(median

Re: [R] References for book R In Action by Kabacoff

2011-12-01 Thread Tyler Rinker
In the ebook version there is a list of references (pp. 434-437). Date: Thu, 1 Dec 2011 10:48:45 +0100 From: lig...@statistik.tu-dortmund.de To: ravi.k...@gmail.com CC: r-help@r-project.org Subject: Re: [R] References for book R In Action by Kabacoff On 01.12.2011 10:10, Ravi Kulkarni

[R] Writing a function, want a string argument to define the name of the excel sheet to be called

2011-12-01 Thread AOLeary
My question is this: is there a way I can make one of the arguments of the function be a string the user can enter, and then have that be the excel filename? ie, foo - function(x,y,NAME){ #make a matrix with x rows and y cols M - matrix(nrow=x,ncol=y) #write the matrix write.table(M, file =

Re: [R] nipals in the chemometrics package in R

2011-12-01 Thread Bryan Hanson
zz dd: If you want a typical score plot, say PC1 vs PC2, then plot the first and second columns of your score matrix (T) against each other and label the points with the row names (if available) or create a text label from where ever you have this information stored. To get an unlabeled score

Re: [R] Writing a function, want a string argument to define the name of the excel sheet to be called

2011-12-01 Thread Bryan Hanson
Sure, change your example as follows and then you can pass the name properly: foo - function(x,y,NAME = filename.csv){ #make a matrix with x rows and y cols M - matrix(nrow=x,ncol=y) #write the matrix write.table(M, file = NAME,append=TRUE, sep = ,) } Bryan Prof. Bryan Hanson

Re: [R] efficient ways to dynamically grow a dataframe

2011-12-01 Thread jim holtman
First, dataframes can be much slower than matrices, for example, if you are changing/accessing values a lot. I would suggest that you use a matrix since is seems that all your values are numeric. Allocate a large empty matrix to start (hopefully as large as you need). If you exceed this, you

Re: [R] ordinal data simulation

2011-12-01 Thread David Winsemius
On Dec 1, 2011, at 2:06 AM, yuying shi wrote: Dear all, I am doing an ordinal data simulation. I have a question regarding the cut off values between categories. Suppose I have three categories, if I do regression, there should be two cut off values. I find some simulation code for the

Re: [R] Raster manipulation in R

2011-12-01 Thread jon . skoien
Hi, Alternatively you could have a look at the function terrain in the raster package, it can calculate the slope for you using different algorithms, not sure if the one below is included though. For typical spatial requests like this, you could also use the mailing-list r-sig-geo.

Re: [R] R logo in eps formt

2011-12-01 Thread Matt Shotwell
See this earlier post for SVG logos: http://tolstoy.newcastle.edu.au/R/e12/devel/10/10/0112.html Using Image Magick, do something like convert logo.svg logo.eps On Thu, 2011-12-01 at 10:56 +0700, Ben Madin wrote: G'day all, Sorry if this message has been posted before, but searching for

Re: [R] FIML with missing data in sem package

2011-12-01 Thread Dustin Fife
Good idea. I'll give it a try. Thanks! On Thu, Dec 1, 2011 at 6:18 AM, John Fox j...@mcmaster.ca wrote: Dear Dustin, -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Dustin Fife Sent: November-30-11 9:51 PM To:

Re: [R] how to get inflection point in binomial glm

2011-12-01 Thread Rubén Roa
Assuming a logistic model, for each group solve for d at Y=0, or solve for d at p=0.5, where d is your continuous predictor, Y is the logit score, and p is the probability of success in the binomial model. After that you can get the standard error of the inflection point by Taylor series (aka

Re: [R] x, y for point of intersection

2011-12-01 Thread Monica Pisica
Hi everybody, Thanks for checking my code, Hans, it help to see where my initial mistake was. I am sorry i assumed that there was a minimization problem. In short i had 2 wavy lines (left and right) that didn't intersect and lots of straight parallel lines that intersect the first 2 lines. I

Re: [R] hi all.regarding quantile regression results..

2011-12-01 Thread R. Michael Weylandt michael.weyla...@gmail.com
This really isn't the appropriate forum for most of your questions: I'd suggest you work through the Wikipedia article on quantiles regression and direct follow up to stats.stackexchange.com. As to the R question: use the predict() function. Michael On Dec 1, 2011, at 8:12 AM, narendarreddy

Re: [R] efficient ways to dynamically grow a dataframe

2011-12-01 Thread R. Michael Weylandt
I'd also suggest you read circle 2 of the R inferno (just google it) which has some helpful tips on how to deal with these sorts of problems. Also, did you know that matrices can have column names and that rbind() preserves them? E.g., m - matrix(1:6, 3); colnames(m) - letters[1:2] print(m)

[R] round to specific intervals

2011-12-01 Thread Michael Kao
Dear R users/helpers, I am wondering is there an existing function in which you can round numbers to a set of values. I know you can use 5 * round(x/5) for rounding to the nearest 5 or so, but what if the interval size is not constant. For example: ## Not run test - rnorm(100) round(test,

Re: [R] Nomogram with stratified cph in rms package, how to get failure probability

2011-12-01 Thread Frank Harrell
Hazard() is not implemented except for parametric survival models. You are not calling nomogram() correctly; in rms the plotting step is separated from the nomogram computations. To plot cumulative event rates do something like: mort10 - function(lp) 1 - surv(10,lp) and tell nomogram about

Re: [R] round to specific intervals

2011-12-01 Thread Bert Gunter
?findInterval .. would get you the endpoints and then you could determine which is nearer. Of course in your example, everything would get rounded to 1. -- Bert On Thu, Dec 1, 2011 at 7:55 AM, Michael Kao mkao006rm...@gmail.com wrote: Dear R users/helpers, I am wondering is there an existing

Re: [R] Writing a function, want a string argument to define the name of the excel sheet to be called

2011-12-01 Thread AOLeary
Thank you very much, that does exactly what I want it to! :) Aodhán -- View this message in context: http://r.789695.n4.nabble.com/Writing-a-function-want-a-string-argument-to-define-the-name-of-the-excel-sheet-to-be-called-tp4128384p4128495.html Sent from the R help mailing list archive at

[R] R, PostgresSQL and poor performance

2011-12-01 Thread Berry, David I.
Hi List Apologies if this isn't the correct place for this query (I've tried a search of the mail archives but not had much joy). I'm running R (2.14.0) on a Mac (OSX v 10.5.8, 2.66GHz, 4GB memory) and am having a few performance issues with reading data in from a Postres database (using

[R] How to do Hotelling's t2 test?

2011-12-01 Thread jpquinn91
Hi, I want to do a 2 sample hotelling's test but i can't figure out how. When i type T2.test it says there is no such test and when i tried library(rrcov) it says there is no such program. Cheers. -- View this message in context:

Re: [R] Resampling with replacement on a binary (0, 1) dataset to get Cis

2011-12-01 Thread lincoln
Thanks. So, suppose for one specific year (first year over 10) the percentage of successes deriving from 100 trials with 38 successes (and 62 failures), its value would be 38/100=0.38. I could calculate its confidence intervals this way: success-38 total-100

Re: [R] How to speed up int2bin conversion?

2011-12-01 Thread Jonas Jägermeyr
On 12/01/2011 02:46 PM, jim holtman wrote: If we assume that you are just convert 8 bits, here is one way with a table lookup. If more than 8 bits, just partition the data and repeat. This sets up a mapping table one time for the lookup. Does 1M in 0.3 seconds on my computer; is this fast

Re: [R] FIML with missing data in sem package

2011-12-01 Thread Dustin Fife
What is your goal? I have used and like mice pretty well, but using mice + sem to try to address missingness seems like more work than using FIML in OpenMx or lavaan to try to address it. Is there a reason you want to use the sem package or a reason you do not want to use the others? I

Re: [R] Nomogram with stratified cph in rms package, how to get failure probability

2011-12-01 Thread min
Got it. Thank you so much for the help! Min Yi MD, PhD Department of Surgical Oncology - Unit 1484 1400 Pressler Street, #FCT17.6061 University of Texas M.D. Anderson Cancer Center P.O. Box 301402 Houston, TX 77230-1402 Phone: 713-563-1874 Fax: 713-792-4689 From: Frank Harrell [via R]

Re: [R] round to specific intervals

2011-12-01 Thread Duncan Murdoch
On 01/12/2011 10:55 AM, Michael Kao wrote: Dear R users/helpers, I am wondering is there an existing function in which you can round numbers to a set of values. I know you can use 5 * round(x/5) for rounding to the nearest 5 or so, but what if the interval size is not constant. For example: ##

Re: [R] Random Forests in R

2011-12-01 Thread Liaw, Andy
The first version of the package was created by re-writing the main program in the original Fortran as C, and calls other Fortran subroutines that were mostly untouched, so dynamic memory allocation can be done. Later versions have most of the Fortran code translated/re-written in C.

Re: [R] How to speed up int2bin conversion?

2011-12-01 Thread Jeff Newmiller
You might be interested in package bit. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

Re: [R] round to specific intervals

2011-12-01 Thread Michael Kao
Thanks for all the response, I manage to write a small function to complete what I want based on the wonderful helps. iround - function(x, interval){ ## Round numbers to desired interval ## ## Args: ## x:Numeric vector to be rounded ## interval: The interval

Re: [R] how to get inflection point in binomial glm

2011-12-01 Thread David Winsemius
On Dec 1, 2011, at 8:24 AM, René Mayer wrote: Dear All, I have a binomial response with one continuous predictor (d) and one factor (g) (8 levels dummy-coded). glm(resp~d*g, data, family=binomial) Y=b0+b1*X1+b2*X2 ... b7*X7 Dear Dr Mayer; I think it might be a bit more complex than

Re: [R] How to do Hotelling's t2 test?

2011-12-01 Thread S Ellison
Hi, I want to do a 2 sample hotelling's test but i can't figure out how. When i type T2.test it says there is no such test and when i tried library(rrcov) it says there is no such program. Have you installed rrcov using install.packages? S

Re: [R] Resampling with replacement on a binary (0, 1) dataset to get Cis

2011-12-01 Thread David Winsemius
On Dec 1, 2011, at 10:49 AM, lincoln wrote: Thanks. So, suppose for one specific year (first year over 10) the percentage of successes deriving from 100 trials with 38 successes (and 62 failures), its value would be 38/100=0.38. I could calculate its confidence intervals this way:

[R] legend, lheight, and alignment

2011-12-01 Thread emorway
Hello, A bit of fairly simple code, yet I don't seem to be able to manipulate it quite as much as I would like: 1) It would be nice if the objects appearing in the legend were aligned, and by aligned I mean the boxes are centered over the lines. Do I need to adjust the use of NA in the code

Re: [R] FIML with missing data in sem package

2011-12-01 Thread yrosseel
On 12/01/2011 05:25 PM, Dustin Fife wrote: What is your goal? I have used and like mice pretty well, but using mice + sem to try to address missingness seems like more work than using FIML in OpenMx or lavaan to try to address it. Is there a reason you want to use the sem package or a reason

Re: [R] R, PostgresSQL and poor performance

2011-12-01 Thread Gabor Grothendieck
On Thu, Dec 1, 2011 at 10:02 AM, Berry, David I. d...@noc.ac.uk wrote: Hi List Apologies if this isn't the correct place for this query (I've tried a search of the mail archives but not had much joy). I'm running R (2.14.0)  on a Mac (OSX v 10.5.8, 2.66GHz, 4GB memory) and am having a few

[R] R package source branching

2011-12-01 Thread Mehmet Suzen
Dear List, I was wondering if any of you worked on an R package which has many branches on a repository i.e. SVN. Is it recommended to branch an R package source tree based on a specific project? I know it depends on project but it would be great to hear opinions from R community. Best,

Re: [R] vector

2011-12-01 Thread Sarah Goslee
Hi, On Thu, Dec 1, 2011 at 10:35 AM, Majid golden_boy...@yahoo.com wrote: Hi. Can you please answer to my questions about R ? 1.how can I write command for vector ? for exaple in this sample : I have this : a1 - c (1:10) now how can I put in the vector ? I'm afraid I don't understand

[R] What's the baseline model when using coxph with factor variables?

2011-12-01 Thread Andreas Schlicker
Hi all, I'm trying to fit a Cox regression model with two factor variables but have some problems with the interpretation of the results. Considering the following model, where var1 and var2 can assume value 0 and 1: coxph(Surv(time, cens) ~ factor(var1) * factor(var2), data=temp) What is

Re: [R] References for book R In Action by Kabacoff (Uwe Ligges)

2011-12-01 Thread Pablo Domínguez Vaselli
The references are here: http://manning.com/kabacoff/excerpt_references.pdf (they will be included on the next printing too, got omitted by mistake) regards, Pablo [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Counting the occurences of a charater within a string

2011-12-01 Thread Douglas Esneault
I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level. My dataframe, x, is structured as below: Col1 abc/def ghi/jkl/mno I found this code on the board but it counts all occurrences of / in the

[R] Estimation of AR(1) Model with Markov Switching

2011-12-01 Thread napps22
Dear R users, I have been trying to obtain the MLE of the following model state 0: y_t = 2 + 0.5 * y_{t-1} + e_t state 1: y_t = 0.5 + 0.9 * y_{t-1} + e_t where e_t ~ iidN(0,1) transition probability between states is 0.2 I've generated some fake data and tried to estimate the parameters using

Re: [R] bigmemory on Solaris

2011-12-01 Thread RogerP
Thanks again for your help. I've been able to add several packages, bigmemory seems to be the only one to fail and it fails on isinf. Is there a way I can download the code and change it to include a ininf function or definition? I'm using the GNU compiler; should I have been using the SUN

Re: [R] What's the baseline model when using coxph with factor variables?

2011-12-01 Thread David Winsemius
On Dec 1, 2011, at 12:00 PM, Andreas Schlicker wrote: Hi all, I'm trying to fit a Cox regression model with two factor variables but have some problems with the interpretation of the results. Considering the following model, where var1 and var2 can assume value 0 and 1:

[R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred

2011-12-01 Thread Ben quant
Sorry if this is a duplicate: This is a re-post because the pdf's mentioned below did not go through. Hello, I'm new'ish to R, and very new to glm. I've read a lot about my issue: Warning message: glm.fit: fitted probabilities numerically 0 or 1 occurred ...including:

Re: [R] What's the baseline model when using coxph with factor variables?

2011-12-01 Thread William Dunlap
Terry will correct me if I'm wrong, but I don't think the answer to this question is specific to the coxph function. For all the [well-written] formula-based modelling functions (essentially, those that call model.frame and model.matrix to interpret the formula) the option contrasts controls how

Re: [R] Counting the occurences of a charater within a string

2011-12-01 Thread Bert Gunter
## It's not a data frame -- it's just a vector. x [1] abc/def ghi/jkl/mno gsub([^/],,x) [1] / // nchar(gsub([^/],,x)) [1] 1 2 ?gsub ?nchar -- Bert On Thu, Dec 1, 2011 at 8:32 AM, Douglas Esneault douglas.esnea...@mecglobal.com wrote: I am new to R but am experienced SAS user and I

Re: [R] Writing a function, want a string argument to define the name of the excel sheet to be called

2011-12-01 Thread R. Michael Weylandt
Just a heads up -- I don't think your code will work with an actual .xls(x) file, only .txt, .csv, etc (aka, plain text files). I may be wrong about that, but if you actually need to work with Excel files directly you will need an additional package. Michael On Thu, Dec 1, 2011 at 9:10 AM,

[R] transform data.frame holding answers -- data.frame holding logicals

2011-12-01 Thread saschaview
Hello Hello I have a data frame, x, holding 5 persons answering the question which cars they have used: # the data frame x - as.data.frame( matrix( c('BMW', '', '', 'Mercedes', 'VW', '', 'Skoda', 'VW', 'BMW', '', '', '', 'VW', 'Skoda', '' ), ncol=3,

Re: [R] Replace columns in a data.frame randomly splitted

2011-12-01 Thread R. Michael Weylandt
I repeat myself: Any more automated solution will depend on whether your data has rownames or not. [...] create a plain text representation of R data using the dput() command. Another way that might make more sense is to cbind() the data you need later on before the split and then it will be

Re: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred

2011-12-01 Thread peter dalgaard
On Dec 1, 2011, at 18:54 , Ben quant wrote: Sorry if this is a duplicate: This is a re-post because the pdf's mentioned below did not go through. Still not there. Sometimes it's because your mailer doesn't label them with the appropriate mime-type (e.g. as application/octet-stream, which is

[R] Change the limits of a plot a posteriori

2011-12-01 Thread jcano
Hi all How can I change the limits (xlim or ylim) in a plot that has been already created? For example, consider this naive example curve(dbeta(x,2,4)) curve(dbeta(x,8,13),add=T,col=2) When adding the second curve, it goes off the original limits computed by R for the first graph, which are

[R] Assign name to object for each iteration in a loop.

2011-12-01 Thread lglew
Hi R-users, I'm trying to produce decompositions of a multiple time-series, grouped by a factor (called area). I'm modifying the code in the STLperArea function of package ndvits, as this function only plots produces stl plots, it does not return the underlying data. I want to extract the trend

[R] nested random effects with lmer

2011-12-01 Thread Charles Li
Hi, I have a multilevel situation where subjects are nested within clinics, and each subject has multiple measurements. For simplicity, suppose there 4 clinics, 3 subjects per clinic, and each subject has 3 repeated measures. Outcome is continuous. I am trying to implement this model with

[R] question about plsr() results

2011-12-01 Thread Vytautas Rakeviius
Hi, With some help I learned how to use plsr(Y~x, 2, data=my) function in R (and build my from vector Y and matrix x). But still I have question about results interpretation. In the end I want to construct prediction function in form: Y=a1x1+a2x2 But I do not understand how to do it.

Re: [R] Change the limits of a plot a posteriori

2011-12-01 Thread Jean V Adams
jcano wrote on 12/01/2011 12:12:03 PM: Hi all How can I change the limits (xlim or ylim) in a plot that has been already created? For example, consider this naive example curve(dbeta(x,2,4)) curve(dbeta(x,8,13),add=T,col=2) When adding the second curve, it goes off the original

Re: [R] how to get inflection point in binomial glm

2011-12-01 Thread René Mayer
Thanks David and Rubén! @David: indeed 15 betas I forgot the interaction terms, thanks for correcting! @Rubén: the re-parameterize would be done within nls()? how to do this practically with including the factor predictor? and yes, we can solve within each group for Y=0 getting 0=b0+b1*X

Re: [R] Assign name to object for each iteration in a loop.

2011-12-01 Thread R. Michael Weylandt
I think part of your problem is the loop: you probably mean for(i in unique(area)) Michael On Thu, Dec 1, 2011 at 1:13 PM, lglew l.g...@soton.ac.uk wrote: Hi R-users, I'm trying to produce decompositions of a multiple time-series, grouped by a factor (called area). I'm modifying the code

Re: [R] Change the limits of a plot a posteriori

2011-12-01 Thread Duncan Murdoch
On 01/12/2011 1:12 PM, jcano wrote: Hi all How can I change the limits (xlim or ylim) in a plot that has been already created? You can't, if you're using classic R graphics. They use an ink on paper model of graphics. If you want to change what you've drawn, you get a new piece of paper.

Re: [R] transform data.frame holding answers -- data.frame holding logicals

2011-12-01 Thread Jean V Adams
saschaview wrote on 12/01/2011 12:30:18 PM: Hello I have a data frame, x, holding 5 persons answering the question which cars they have used: # the data frame x - as.data.frame( matrix( c('BMW', '', '', 'Mercedes', 'VW', '', 'Skoda', 'VW', 'BMW', '',

Re: [R] vector

2011-12-01 Thread Sarah Goslee
Hi, On Thu, Dec 1, 2011 at 2:43 PM, Majid golden_boy...@yahoo.com wrote: Dear Sarah. Thanks so much,Really I am new in this software,I am wrking to learn the software. First, you should always send your replies to the list. That way information can help others, and more people are available

Re: [R] What's the baseline model when using coxph with factor variables?

2011-12-01 Thread David Winsemius
On Dec 1, 2011, at 1:00 PM, William Dunlap wrote: Terry will correct me if I'm wrong, but I don't think the answer to this question is specific to the coxph function. It depends on our interpretation of the questioner's intent. My answer was predicated on the assumption that the phrase

Re: [R] vector

2011-12-01 Thread Sarah Goslee
On Thu, Dec 1, 2011 at 3:11 PM, Majid golden_boy...@yahoo.com wrote: Hi, yes, It is homework, Then ask your TA/instructor for help. These are 2 command: first for generating data: (1:10) that output is 1 2 310 ok ? second is : a1-c( 1:10) what is the output ?I didnot see any

Re: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred

2011-12-01 Thread Ben quant
Thank you for the feedback, but my data looks fine to me. Please tell me if I'm not understanding. I followed your instructions and here is a sample of the first 500 values : (info on 'd' is below that) d - as.data.frame(l_yx) x = with(d, y[order(x)]) x[1:500] # I have 1's and 0's dispersed

[R] calculate mean of multiple rows in a data frame

2011-12-01 Thread Jabez Wilson
Dear all, I have a data frame (DF) in the following format: NAME ID a b c d 1 Control_1 probe~B01R01C01 381 213 345 653 2 Control_2 probe~B01R01C02 574 629 563 783 3 Control_1 probe~B01R09C01 673 511 521 967 4 Control_3 probe~B01R09C02 53 809 999 50 5 MM0289~RFU:11810.15

Re: [R] combining arima and ar function

2011-12-01 Thread R. Michael Weylandt
I think your attachment got scrubbed so I can't verify this, but i think the difficulty is that the inner apply returns a whole set of orders, instead of just one and that throws arima off: would this work? getOrder - function(x) ar(na.omit(x), method = mle)$order all.equal(apply(TSX, 2,

[R] Fw: calculate mean of multiple rows in a data frame

2011-12-01 Thread Jabez Wilson
NAME ID a b c d 1 Control_1 probe~B01R01C01 381 213 345 653 2 Control_2 probe~B01R01C02 574 629 563 783 3 Control_1 probe~B01R09C01 673 511 521 967 4 Control_3 probe~B01R09C02 53 809 999 50 5 MM0289~RFU:11810.15 probe~B29R13C06 681 34 115 587 6 MM0289~RFU:9238.41 probe~B29R13C05 784 443

Re: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred

2011-12-01 Thread peter dalgaard
On Dec 1, 2011, at 21:32 , Ben quant wrote: Thank you for the feedback, but my data looks fine to me. Please tell me if I'm not understanding. Hum, then maybe it really is a case of a transition region being short relative to the range of your data. Notice that the warning is just that: a

[R] MCMCglmm error with multinomial distribution

2011-12-01 Thread Håvard Wahl Kongsgård
With binomial/binary responses (0|1) running MCMCglmm with family=multinomial terminates with Error in if (nJ 1) { : missing value where TRUE/FALSE needed with family=categorical there are no errors I have not looked in the code, do I need format the responses TRUE/FALSE , or is this just a

  1   2   >