[R] How to fit a Tobit model with observations censored at different values

2008-01-12 Thread Yongfu He
Dear everyone: I am a new user of R. I have a dataset with a dependent variable (DV) censored at different values. The dataset looks like, conditions .IDV1 IDV2DV 12 4 89 16 6 75 14 5 0 ( DV<=7

Re: [R] What is the 'scale' in princomp() function?

2008-01-12 Thread Prof Brian Ripley
On Sun, 13 Jan 2008, Xingwang Ye wrote: > Dear R users, > When I tried to use princomp() from stats packages to do Principal > Components Analysis, I am not very clear what is the "scale". > And the scores are different from "PROC PRINCOMP" procedure from SAS. > > Using the example data from this

[R] What is the 'scale' in princomp() function?

2008-01-12 Thread Xingwang Ye
Dear R users, When I tried to use princomp() from stats packages to do Principal Components Analysis, I am not very clear what is the "scale". And the scores are different from "PROC PRINCOMP" procedure from SAS. Using the example data from this package: restpc <- princomp(USArrests, cor = TRUE

Re: [R] Newbie syntax question

2008-01-12 Thread jim holtman
?cor.test and the help page says: formula: a formula of the form ~ u + v, where each of u and v are numeric variables giving the data values for one sample. The samples must be of the same length. On 1/12/08, Joe Trubisz <[EMAIL PROTECTED]> wrote: > Hi... > > I'm trying to understand the follo

[R] Newbie syntax question

2008-01-12 Thread Joe Trubisz
Hi... I'm trying to understand the following syntax: cor.test(~mortality + hardness,data=water,method="pearson") which is the same as: cor.test(water$mortality,water$hardness,data=water,method="pearson") Can anyone point me to the correct doc or explain to me how to interpret "~mortality + h

[R] Alborques Online Gallery

2008-01-12 Thread jzarro
Olá! Acabam de ser publicados mais alguns trabalhos de pintura na Galeria Online Alborques (WWW.Alborques.com ). Além disso, é apresentado mais um dos artistas residentes da Galeria, Henrique Padeiro, um jovem escritor que já tem esgotada a 1ª edição do seu livro "Gua

Re: [R] product of vector elements

2008-01-12 Thread Gerard Smits
Thanks for cumprod() and prod(). I should have tried the help.search first. Next time Gerard At 04:55 PM 1/12/2008, Gabor Grothendieck wrote: >help.search("product") > >On Jan 12, 2008 7:38 PM, Gerard Smits <[EMAIL PROTECTED]> wrote: > > All, > > > > I would like to find a simper method th

Re: [R] odfWeave and xtable

2008-01-12 Thread 宋时歌
Dear Max: This is very helpful, thank you. By the way, nice work on odfWeave! Best, Shige On Jan 13, 2008 4:09 AM, Max Kuhn <[EMAIL PROTECTED]> wrote: > One thing on my (neglected) to-do list for odfWeave is to create a > general class called odf that can be used to create output for common > mo

Re: [R] product of vector elements

2008-01-12 Thread Daniel Nordlund
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf > Of Gerard Smits > Sent: Saturday, January 12, 2008 4:39 PM > To: r-help@r-project.org > Subject: [R] product of vector elements > > All, > > I would like to find a simper method that I now have to find th

Re: [R] product of vector elements

2008-01-12 Thread Gabor Grothendieck
help.search("product") On Jan 12, 2008 7:38 PM, Gerard Smits <[EMAIL PROTECTED]> wrote: > All, > > I would like to find a simper method that I now have to find the > product of all elements in a vector: > > #get product of vector elements: (1,2,3,4,5) > vec.product <- exp(sum(log(c(1,2,3,4,5

Re: [R] product of vector elements

2008-01-12 Thread Chuck Cleland
On 1/12/2008 7:38 PM, Gerard Smits wrote: > All, > > I would like to find a simper method that I now have to find the > product of all elements in a vector: > > #get product of vector elements: (1,2,3,4,5) > vec.product <- exp(sum(log(c(1,2,3,4,5 > > I have not found a vector product funct

[R] product of vector elements

2008-01-12 Thread Gerard Smits
All, I would like to find a simper method that I now have to find the product of all elements in a vector: #get product of vector elements: (1,2,3,4,5) vec.product <- exp(sum(log(c(1,2,3,4,5 I have not found a vector product function, if one has been written. Thanks, Gerard [[al

Re: [R] Lattice equivalent of par(mfrow = )

2008-01-12 Thread Deepayan Sarkar
On 1/12/08, Michael Kubovy <[EMAIL PROTECTED]> wrote: > Dear r-helpers, > > Does anyone have a straightforward example of putting together three > unrelated (expect for a common y-axis) xyplot() figures in what would > be in base graphics a par(mfrow = c(1, 3)) arrangement? See the examples in ?pr

[R] הכי זול ברשת בחיי

2008-01-12 Thread טובה
אתר שמצאתי ברשת לא להאמין כמה זול מגוון מוצרים הכי זול באינטרנט שירות לקוחות יוצא מן הכלל היכנסו לכאן http://www.go443.co.il/Go443/Shop3/index.asp __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the postin

Re: [R] Lattice equivalent of par(mfrow = )

2008-01-12 Thread Gabor Grothendieck
Check out: https://stat.ethz.ch/pipermail/r-devel/2005-June/033508.html On Jan 12, 2008 4:46 PM, Michael Kubovy <[EMAIL PROTECTED]> wrote: > Dear r-helpers, > > Does anyone have a straightforward example of putting together three > unrelated (expect for a common y-axis) xyplot() figures in what w

[R] Lattice equivalent of par(mfrow = )

2008-01-12 Thread Michael Kubovy
Dear r-helpers, Does anyone have a straightforward example of putting together three unrelated (expect for a common y-axis) xyplot() figures in what would be in base graphics a par(mfrow = c(1, 3)) arrangement? _ Professor Michael Kubovy University of Virginia Depar

[R] Jual es puter HOME MADEdijamin enak dan puas ..

2008-01-12 Thread Ibu Lilis
Halo, Kami ingin menawarkan kepada teman-teman nih.. Es puter buatan kami sendiri dengan berbagai rasa seperti coklat, capucino, duren, kelapa, kacang ijo untuk acara pesta, catering, pernikahan, dll PESAN KE AKU YA.. Terimakasih semua 021 99800771 Lilis __

Re: [R] Count unique rows/columns in a matrix

2008-01-12 Thread Gabor Csardi
Chuck, thanks a lot, this is a very good starting point. G. On Sat, Jan 12, 2008 at 01:08:11PM -0800, Charles C. Berry wrote: [...] > Gabor, > > Try this. Order the matrix rows, conpare adjacent rows, and run length > encode the logical vector of comparisons. Decode the rle() result to get > t

Re: [R] Count unique rows/columns in a matrix

2008-01-12 Thread Charles C. Berry
On Sat, 12 Jan 2008, Gabor Csardi wrote: > On Sat, Jan 12, 2008 at 12:35:47PM -0500, John Kane wrote: >> I definately did not read it that way but that may >> have been my fault. That table approach is quite >> nice! >> >> Using it, you could just rebuild the vectors from the >> names. Does this

Re: [R] glm expand model to more values

2008-01-12 Thread Jarek Jasiewicz
Charles Annis, P.E. wrote: > Jarek: > > Although it is not universally agreed on, I believe the first step in any > data analysis is to PLOT YOUR DATA. > > dd <- data.frame(a=c(1, 2, 3, 4, 5, 6), b=c(3, 5, 6, 7, 9, 10)) > plot(b ~ a, data=dd) > simple.model <- lm(b~a,data=dd) > abline(simple.mo

Re: [R] odfWeave and xtable

2008-01-12 Thread Max Kuhn
One thing on my (neglected) to-do list for odfWeave is to create a general class called odf that can be used to create output for common models (lm, glm etc). The nice thing here is that the output from this function could write mixed output. For example, a short paragraph about the specified model

Re: [R] glm expand model to more values

2008-01-12 Thread Charles Annis, P.E.
Jarek: Although it is not universally agreed on, I believe the first step in any data analysis is to PLOT YOUR DATA. dd <- data.frame(a=c(1, 2, 3, 4, 5, 6), b=c(3, 5, 6, 7, 9, 10)) plot(b ~ a, data=dd) simple.model <- lm(b~a,data=dd) abline(simple.model) Why to you think you need a cubic mod

Re: [R] R extensions

2008-01-12 Thread Duncan Murdoch
On 12/01/2008 2:13 PM, Edna Bell wrote: > Dear R Gurus: > > I'm reading through the "Writing R Extensions" manual. > > I am seeing references to "load hooks" and SEXPR but have no ideas > what these are. > > Could someone give me some direction as to finding out about these, please? SEXP is the

[R] Nesting a factor within an interaction term

2008-01-12 Thread Stephen Cole
Hello all - I have been teaching myself R and have run into a problem that i cant seem to find an answer too. I appreciate any advice that can be given. My Design is a 2 level nested design with Site nested in the interaction of Region * Habitat The response variable i have been using are my qua

Re: [R] Factor Analysis

2008-01-12 Thread John Fox
Dear Kathleen, You can use the sem() function in the sem package to fit CFA models from tetrachoric correlations computed with the polycor package. See ?boot.sem in the sem package for an example using polychoric correlations for ordinal observed variables (tetrachoric correlations are a special c

Re: [R] Count unique rows/columns in a matrix

2008-01-12 Thread Gabor Csardi
On Sat, Jan 12, 2008 at 12:35:47PM -0500, John Kane wrote: > I definately did not read it that way but that may > have been my fault. That table approach is quite > nice! > > Using it, you could just rebuild the vectors from the > names. Does this do more or less what you want? John, thanks. Sti

[R] R extensions

2008-01-12 Thread Edna Bell
Dear R Gurus: I'm reading through the "Writing R Extensions" manual. I am seeing references to "load hooks" and SEXPR but have no ideas what these are. Could someone give me some direction as to finding out about these, please? Thanks, Edna Bell __ R

Re: [R] glm expand model to more values

2008-01-12 Thread Jarek Jasiewicz
Charles Annis, P.E. wrote: > How many parameters are you trying to estimate? How many observations do > you have? > > What is wrong is that half of your parameter estimates are statistically > meaningless: > > dd <- data.frame(a=c(1, 2, 3, 4, 5, 6), b=c(3, 5, 6, 7, 9, 10)) > > overparameterize

Re: [R] pairwise cross tabulation tables

2008-01-12 Thread Charles C. Berry
On Fri, 11 Jan 2008, AndyZon wrote: > > > Another question: > > Is it possible to make 3-variable cross tabulations (I mean, plus another > dichotomous variable), such as 2*3*3, 3*2*3, or 3*3*2? Can we do it in > similar ways as just 2-variables? If you mean to stratify all of the other variables

Re: [R] glm expand model to more values

2008-01-12 Thread Charles Annis, P.E.
How many parameters are you trying to estimate? How many observations do you have? What is wrong is that half of your parameter estimates are statistically meaningless: dd <- data.frame(a=c(1, 2, 3, 4, 5, 6), b=c(3, 5, 6, 7, 9, 10)) overparameterized.model <- glm(b~poly(a,3),data=dd) summa

Re: [R] odfWeave and xtable

2008-01-12 Thread Frank E Harrell Jr
??? wrote: > Dear All, > > I am new to odfWeave and was wondering if there are something similar > to the xtable package that can automatically convert model > coefficients into LaTeX/ODT tables? More generally, how do people who > use odfWeave transform model results into tables? The odfTable do

[R] odfWeave and xtable

2008-01-12 Thread 宋时歌
Dear All, I am new to odfWeave and was wondering if there are something similar to the xtable package that can automatically convert model coefficients into LaTeX/ODT tables? More generally, how do people who use odfWeave transform model results into tables? The odfTable does not seem to be able

Re: [R] glm expand model to more values

2008-01-12 Thread Greg Snow
Either use the predict function to create the new predictions, or use the raw argument to poly. From: [EMAIL PROTECTED] on behalf of Jarek Jasiewicz Sent: Sat 1/12/2008 9:50 AM To: R-help@r-project.org Subject: [R] glm expand model to more values Hi I have th

[R] glm expand model to more values

2008-01-12 Thread Jarek Jasiewicz
Hi I have the problem with fitting curve to data with lm and glm. When I use polynominal dependiency, fitted values from model are OK, but I cannot recive proper values when I use coefficents to caltulate this. Let me present simple example: I have simple data.frame: (dd) a: 1 2 3 4 5 6 b:

Re: [R] question about xreg of arima

2008-01-12 Thread Richard Saba
Tom A constant term is not included in the model if any differencing is specified. The xreg= parameter is used to add other explanatory variables to the model. In your case xreg=1:length(x) adds a vector of 1's to the model. Robert Shumway and David Stoffer's website for their "Time Series Analys

Re: [R] Factor Analysis

2008-01-12 Thread Dimitris Rizopoulos
you may check the ltm package: http://wiki.r-project.org/rwiki/doku.php?id=packages:cran:ltm I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(

Re: [R] How to disable output messages (prints or cats) from functions in R?

2008-01-12 Thread Miguel Ratón Almansa
Thank you. That works fine. ;-) Miguel Henrik Bengtsson escribió: > log <- capture.output({ > res <- theFunction(...); > }) > print(res); > > /H > > On 12/01/2008, Miguel Ratón Almansa <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> I've tried it but I need the object returned by the function and

Re: [R] Is R on Windows multi-threaded

2008-01-12 Thread Dirk Eddelbuettel
On 11 January 2008 at 21:37, Greg Snow wrote: | Someone else suggested the snow package, but I don't think it is available for windows. It is, but you may have to restrict yourself to the 'sockets' communication as PVm and MPI are not that straightforward under Unix. | I have been able to get t

Re: [R] Problem with strptime

2008-01-12 Thread Dirk Eddelbuettel
On 12 January 2008 at 16:18, Sandrine-et-Francois wrote: | Dear R-list, | I'm experiencing some problems while using "strptime", which I don't understand. | | > str(natver) | 'data.frame': 154 obs. of 8 variables: | $ ID : Factor w/ 14 levels "AC","ALS","FA",..: 10 11 9 1 4 8 13 3 14 12

[R] Problem with strptime

2008-01-12 Thread Sandrine-et-Francois
Dear R-list, I'm experiencing some problems while using "strptime", which I don't understand. > str(natver) 'data.frame': 154 obs. of 8 variables: $ ID : Factor w/ 14 levels "AC","ALS","FA",..: 10 11 9 1 4 8 13 3 14 12 ... $ CdBMin : int 22 22 26 26 28 23 27 23 25 26 ... $ CdBMax :

[R] GLM/VGAM exponential weighting and sequential regression

2008-01-12 Thread Benoit J
Hello I have a data.frame with first column date (possibly several rows with same date) second column X1 and third X2 for example i would like to regress X1 on X2 but with exponential weight i.e. give more weights to last observations and i would like to do this in sequential mode i.e for first

[R] Factor Analysis

2008-01-12 Thread Kathleen Kemp
Good Morning, Is it possible to use the R program for a CFA with dichotomous data? Thank you, Kathleen Kathleen Kemp, M.A. Doctoral Clinical Psychology Student, Concentration: Forensic Psychology Drexel University Philadelphia, PA 19104 [EMAIL PROTECTED] [[alternative HTML version d

Re: [R] How to disable output messages (prints or cats) from functions in R?

2008-01-12 Thread Henrik Bengtsson
log <- capture.output({ res <- theFunction(...); }) print(res); /H On 12/01/2008, Miguel Ratón Almansa <[EMAIL PROTECTED]> wrote: > Hi, > > I've tried it but I need the object returned by the function and if I > use capture.output() I lose it because It returns a string, not the > object. I wan

Re: [R] How to disable output messages (prints or cats) from functions in R?

2008-01-12 Thread Miguel Ratón Almansa
Hi everybody, after several attempts I've got what I wanted using the sink() function. If someone need it all you have to do is the following: sink("aux"); object <- yourFunction(...); sink(NULL); Now you can use the returned object without having been showed the output information. Miguel

Re: [R] How to disable output messages (prints or cats) from functions in R?

2008-01-12 Thread Miguel Ratón Almansa
Hi, I've tried it but I need the object returned by the function and if I use capture.output() I lose it because It returns a string, not the object. I want the returned object without the displaying information showed by the function. Something like suppressWarnings( ) but suppressing the sta

Re: [R] Oddities with RSiteSearch?

2008-01-12 Thread Jonathan Baron
Actually I fixed my end of the problem soon after it was reported. (It was because I hadn't updated some soft links after upgrading to Fedora 8, which installed a new version of Namazu.) I could not replicate the "download" problem. The foobar thing is at the namazu site, not mine. I did not rep

Re: [R] Oddities with RSiteSearch?

2008-01-12 Thread Peter Dalgaard
Zembower, Kevin wrote: > [If I knew who to report this to privately, I would. Sorry to embarrass > anyone who's just trying to contribute to the R-project.] > > There seems to be some oddities with the RSiteSearch web page. When I > enter 'RSiteSearch("console")' I'm taken to > http://search.r-proj

Re: [R] how to make read-only data frames?

2008-01-12 Thread Prof Brian Ripley
I don't think anyone in this thread has yet mentioned ?lockBinding. That is the underlying mechanism used to make namespace environments read-only. You can unlock bindings, so strictly nothing in R is completely read-only. On Fri, 11 Jan 2008, Greg Snow wrote: > I think what you want to do is

Re: [R] Is R on Windows multi-threaded

2008-01-12 Thread Prof Brian Ripley
On Fri, 11 Jan 2008, Greg Snow wrote: > Someone else suggested the snow package, but I don't think it is > available for windows. It is. From http://cran.r-project.org/bin/windows/contrib/2.6/ReadMe Although the packages ROracle, and snow pass make check, it seems to be dangerous to