[R] question

2004-04-08 Thread Ja-Yong Koo
Hi, I have found a strange thing. If I copy and paste the R source file, then the result is okay with. However, if I use R GUI (File icon and Source File), then the result is different. Please let me know possible reasons. Many thanks in advance. Best Ja-Yong [[alternative

Re: [R] question

2004-04-08 Thread Tamas Papp
On Fri, Apr 09, 2004 at 01:33:18PM +0900, Ja-Yong Koo wrote: I have found a strange thing. If I copy and paste the R source file, then the result is okay with. However, if I use R GUI (File icon and Source File), then the result is different. Please let me know possible reasons. Next time

[R] Question about error

2004-04-06 Thread DAEYOUNG KIM
Dear Sir.. I am a graduate student in Pennstate. I have some problem in using R. At first, I used image function under R.(I loaded the packages GeoR, geoRglm, and coda) When I performed the following command

Re: [R] Question on Data Simulation

2004-04-02 Thread Göran Broström
On Thu, Apr 01, 2004 at 05:11:31PM +0200, Rau, Roland wrote: Hello, -Original Message- From: Jingky P. Lozano [SMTP:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 2:15 PM To: [EMAIL PROTECTED] Subject:[R] Question on Data Simulation Dear mailing list

[R] Question on Data Simulation

2004-04-01 Thread \Jingky P. Lozano\
Dear mailing list, Do you know a specific package in R where I can create an artificial survival data with controlled censoring condition? (For example, I want to simulate a data set with 5 variables and 20% of the observations are censored.) Many thanks. Jei

RE: [R] Question on Data Simulation

2004-04-01 Thread Rau, Roland
Hello, -Original Message- From: Jingky P. Lozano [SMTP:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 2:15 PM To: [EMAIL PROTECTED] Subject: [R] Question on Data Simulation Dear mailing list, Do you know a specific package in R where I can create an artificial

[R] question on R's makefile and configure system

2004-03-23 Thread Christopher Marshall
I am trying to make a compiled slackware package for R and I am stuck on one point. Is there a variable I can set on the make install step to cause the R files to be copied into a subdirectory, instead of being copied into the prefix path specified in ./configure --prefix=/usr anchored at root?

Re: [R] question on R's makefile and configure system

2004-03-23 Thread Christopher Marshall
I should have cc'd the list in my first response and forgot. This exchange is about which path variables to set in the R make process so you can make a compiled package for a linux distribution. Dirk gave me the missing piece and I am able to compile proper slackware packages now. --- Dirk

[R] Question on deriv3()

2004-03-23 Thread Mervyn G Marasinghe
Hello: Why is deriv3() functioning differently in R from that in Splus using library(MASS) ? For example deriv3(~(t1*log(t2)+lgamma(t1)+(1-t1)*log(y)+y/t2),c(t1,t2),function(y,t1,t2)NULL) complains of lgamma. Mervyn __ [EMAIL PROTECTED] mailing list

Re: [R] Question on deriv3()

2004-03-23 Thread Prof Brian Ripley
Because it is not the same code. In R, the set of known functions is hard-coded. In S-PLUS, it is extensible, and was extended by MASS (now incorporated into the standard distribution). On Tue, 23 Mar 2004, Mervyn G Marasinghe wrote: Why is deriv3() functioning differently in R from that in

[R] Question: Assigning the values of a time series to another one with dif. length and resolution

2004-03-18 Thread Daebel Helge
Hi, I have two time series organized in matixes data.1 and data.2. They have different length and resolution. matrix data.1 t1 v1 t3 v3 t5 v5 ... matrix data.2 t1 0 t2 0 t3 0 ... desired result: data.2 t1 v1 t2 0 t3 v3 ... What is the MOST EFFECTIVE way (since the matrixes are very

[R] Question concerning library function nlme and lexical scoping

2004-03-10 Thread Jens_Praestgaard
I am running into problems calling the library function nlme from within another function. Basically,the following function (with v a list containing data and initialization values) testfunc function(dat=v) { test-nlsList(result~a+(b-a)/(1+(conc/(c+z*cdiff))^d)

Re: [R] Question concerning library function nlme and lexical scoping

2004-03-10 Thread Prof Brian Ripley
On Wed, 10 Mar 2004 [EMAIL PROTECTED] wrote: I am running into problems calling the library function nlme from within another function. Basically,the following function (with v a list containing data and initialization values) testfunc function(dat=v) {

[R] question

2004-03-08 Thread cfinet
I do not manage to make a Fisher´s exact test with the next matrix : [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,]130129002 5 8 6 [2,]033000050 3 0 0 [3,]0000

[R] question on integrate function request for consultant

2004-03-05 Thread s viswanath
Dear R helpers, i am using the ecdf(emp. cumulative distribution function,and am getting the following error on daily returns of stock data (about 2000 data points). I am not sure what this means, I would expect the result of the code to be 1 (the integral from -infinity to +infinity of the

Re: [R] question on integrate function request for consultant

2004-03-05 Thread Prof Brian Ripley
You are trying to integrate a discontinous function, and the answer is +Inf. So the message is correct. An ECDF is one to the right of the largest data point. I wonder what you really want to do. On Fri, 5 Mar 2004, s viswanath wrote: Dear R helpers, i am using the ecdf(emp. cumulative

[R] question about mixed effects model

2004-02-29 Thread Albedo
Hello. I have some trouble with mixed effects in R, similar to problems that other people had with not nested models and lme, as I understand from the mailing list archive. Unfortunately, I could not understand the solutions that were proposed... I have a data set with response variable (y) and

[R] question

2004-02-27 Thread Svetlana Eden
Hi everybody. The question: I get two vectors 'iFalseFalse' and 'i2'. I think they should be the same but they are not. Is it because R does not handle complicated logical expressions in such cases or I do something wrong? z1 = c(NA, , 3, NA, , 3) z2 = c(, , 3, NA, 3, NA) cV =

RE: [R] question

2004-02-27 Thread Austin, Matt
You want to use instead of . --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Svetlana Eden Sent: Friday, February 27, 2004 7:57 AM To: r-help Subject: [R] question Hi everybody. The question: I get two vectors 'iFalseFalse' and 'i2'. I think

Re: [R] question

2004-02-27 Thread Uwe Ligges
Svetlana Eden wrote: Hi everybody. The question: I get two vectors 'iFalseFalse' and 'i2'. I think they should be the same but they are not. Is it because R does not handle complicated logical expressions in such cases or I do something wrong? z1 = c(NA, , 3, NA, , 3) z2 = c(, , 3, NA, 3,

[R] question about setdiff()

2004-02-27 Thread Svetlana Eden
Thank you for your answers, I have another question: the behaviour of setdiff(indicesFalse, indicesNA) does not seem predictable to me. indices [1] 1 2 3 4 5 6 compareVector [1]NA TRUE TRUE TRUE FALSENA indicesNA = indices[is.na(compareVector)] indicesNA [1] 1 6

[R] question about if else

2004-02-27 Thread Svetlana Eden
Today is a good day for asking question, I guess. c() NULL length(c())==0 [1] TRUE r = ifelse(length(c())!=0, c(), c(1,2)) ### OK r = c() ### OK r = ifelse(length(c())==0, c(), c(1,2)) ### why this is not OK (given the previous two)? Error in

RE: [R] question about setdiff()

2004-02-27 Thread Liaw, Andy
`Same' object appearing more than once do not count, I guess. As an example: setdiff(c(1,2,2), c(3,4)) [1] 1 2 The second `2' does not show up, because setdiff function (x, y) unique(if (length(x) || length(y)) x[match(x, y, 0) == 0] else x) environment: namespace:base Note the unique().

RE: [R] question about if else

2004-02-27 Thread Liaw, Andy
You need to (re-)read ?ifelse. In ifelse(L, v1, v2), L is suppose to be a vector of logicals (or an expression that evaluates to one), and v1 and v2 are vectors of same length as L; i.e., ifelse() vectorizes if ... else In the first case: r = ifelse(length(c())!=0, c(), c(1,2))

Re: [R] question about if else

2004-02-27 Thread Don MacQueen
ifelse() has three arguments, named 'test', 'yes', and 'no'. In both of your two examples, you gave it a test argument of length equal to 1. That is, both length(c())!=0 and length(c())==0 are expressions which when evaluated have length equal to 1. Therefore, the ifelse() function wants to

[R] Question concerning functions nlsList and nlme from nlme R library.

2004-02-23 Thread Jens_Praestgaard
I hope that the mailing list is the correct forum for the question below. I have trouble calling functions nlsList and nlme from another function. Any help would be greatly appreciated. Jens Praestgaard Human Genome Sciences Rockville MD. I have a data set v with two components, v$mixeddat and

[R] question about matrix

2004-02-16 Thread Cynthia He
Hello there, How to write this matrix in R? The ^ sign is a power symbol. Thanks a lot! 0^1 0^2 . 0^n 1^1 1^2 . 1^n 2^1 2^2 . 2^n q^1 q^2 . q^n

Re: [R] question about matrix

2004-02-16 Thread Douglas Bates
Cynthia He [EMAIL PROTECTED] writes: How to write this matrix in R? The ^ sign is a power symbol. Thanks a lot! 0^1 0^2 . 0^n 1^1 1^2 . 1^n 2^1 2^2 . 2^n q^1

Re: [R] question about matrix

2004-02-16 Thread Spencer Graves
outer(0:2, 1:2, ^) [,1] [,2] [1,]00 [2,]11 [3,]24 Is this what you want? spencer graves Cynthia He wrote: Hello there, How to write this matrix in R? The ^ sign is a power symbol. Thanks a lot! 0^1 0^2 . 0^n 1^1 1^2 .

[R] Question about design matrix

2004-01-26 Thread Yongwan Chun
Now, I am working with some design matrices. My problem is to set contrasts option. Now I want to use contr.sum as the option, and it works properly. However, this option sets the last element of a factor as -1. For example, if I have a factor which has 5 elements and want to use the contr.sum

[R] Question

2004-01-23 Thread Wassim Kamoum
Hello I' d like to implement a space-time model as it is formulated Technometrics vol 22 1980 A three stage iterative procedure for space-time modelling P,E Pfeiffer, and S.J Deutsch For model identification the sample space-time autocorrelation and partial autocorrelation function are

[R] question

2004-01-23 Thread Wassim Kamoum
Hello I was looking for the source code for the new arima procedure the STARMA model (Space-Time ARMA) If somebody have the source code of this model please send me them I'm student and in my research for my master I'm appling the STARMA model for modelling the pollutant particules. It's

Re: [R] question

2004-01-23 Thread Peter Dalgaard
Wassim Kamoum [EMAIL PROTECTED] writes: Hello I was looking for the source code for the new arima procedure the STARMA model (Space-Time ARMA) If somebody have the source code of this model please send me them I'm student and in my research for my master I'm appling the STARMA

Re: [R] question - STARMA model (Space-Time ARMA)

2004-01-23 Thread Roger Bivand
On 23 Jan 2004, Peter Dalgaard wrote: Wassim Kamoum [EMAIL PROTECTED] writes: Hello I was looking for the source code for the new arima procedure the STARMA model (Space-Time ARMA) If somebody have the source code of this model please send me them I'm student and in my

[R] question

2004-01-20 Thread Wassim Kamoum
Je suis étudiant en DEA et j'élabore un mémoir dans lequel j'applique le modèle STARMA , Pouvez vous ,s'il vous plait, m'envoyer l'algorithme de calcul ces STACF et STPACF de ce model afin de débuter mon estimation de ce modéle sur R Merci d'avance. -

[R] question about how summary.lm works

2004-01-12 Thread Dominic Barraclough
Hi, While exploring how summary.lm generated its output I came across a section that left me puzzled. at around line 57 R - chol2inv(Qr$qr[p1, p1, drop = FALSE]) se - sqrt(diag(R) * resvar) I'm hoping somebody could explain the logic of these to steps or alternatively point me in the

Re: [R] question about how summary.lm works

2004-01-12 Thread Peter Dalgaard
Dominic Barraclough [EMAIL PROTECTED] writes: Hi, While exploring how summary.lm generated its output I came across a section that left me puzzled. at around line 57 R - chol2inv(Qr$qr[p1, p1, drop = FALSE]) se - sqrt(diag(R) * resvar) I'm hoping somebody could

Re: [R] question: DLL or EXE from R procedures

2003-12-24 Thread Uwe Ligges
PaTa PaTaS wrote: Hi, I wonder if it is possible to create an DLL or EXE file performing R procedures. Instead of running R, reading data and calling some procedures, I would like to use R functions in the following way: C:\linearRegression.exe data.txt which would produce let's say

Re: [R] question: DLL or EXE from R procedures

2003-12-24 Thread Spencer Graves
While Uwe is correct about the absence of a compiler for R, one can call R from other languages such as C. A description of this can be found, e.g., from R 1.8.1, help.start() - Writing R Extensions - Evaluating R expressions from C. Also, the many R functions actually call C code,

Re: [R] question: DLL or EXE from R procedures

2003-12-24 Thread Prof Brian Ripley
On Wed, 24 Dec 2003, Spencer Graves wrote: While Uwe is correct about the absence of a compiler for R, one can call R from other languages such as C. A description of this can be found, e.g., from R 1.8.1, help.start() - Writing R Extensions - Evaluating R expressions from C. But

Re: [R] question: DLL or EXE from R procedures

2003-12-24 Thread Gabor Grothendieck
--- x y 1 2 2 4 3 7 Date: Wed, 24 Dec 2003 07:27:08 -0800 From: Spencer Graves [EMAIL PROTECTED] To: Uwe Ligges [EMAIL PROTECTED] Cc: [EMAIL PROTECTED],PaTa PaTaS [EMAIL PROTECTED] Subject: Re: [R] question: DLL or EXE from R procedures While Uwe is correct about the absence

[R] question: DLL or EXE from R procedures

2003-12-23 Thread PaTa PaTaS
Hi, I wonder if it is possible to create an DLL or EXE file performing R procedures. Instead of running R, reading data and calling some procedures, I would like to use R functions in the following way: C:\linearRegression.exe data.txt which would produce let's say file output.txt with the

[R] Question re labels in r-part (continuation of a thread from a while back)

2003-12-19 Thread Peter Flom
Hello again I have modeled a tree using rpart, with the DV being a log transformation of the variable I am really interested in (I transformed the DV due to extreme skewness). By default, text.rpart labels the nodes with the value of yval, which in this case is not what I want; I'd like the

Re: [R] Question re labels in r-part (continuation of a thread from a while back)

2003-12-19 Thread Thomas W Blackwell
Peter - (Just gessing about the structure of rpart objects ...) How about tr.totpart.pruned$frame - cbind(tr.totpart.pruned$frame, meanpart = exp(tr.totpart.pruned$frame$yval)-1) This appends meanpart as an additional column of tr.totpart.pruned$frame. After this

[R] Question about R-editor rwined()

2003-12-12 Thread Shige Song
Deal All, I am interested in using the rwined editor (http://www.wiwi.uni-bielefeld.de/~wolf/software/revweb/revweb.html). My question is: is it German only or there is an English version? I have a slow connection at home and would like to know whether it will work before trying to download it.

[R] question regarding variance components

2003-12-02 Thread Philip Turk
I am using a two-factor ANOVA model with random factor effects including the interaction, i.e. the factors are crossed. I would like to be able to generate all four variance components along with approximate confidence intervals using the NLME package. However, I do not know how to specify the

[R] question

2003-11-19 Thread Fuensanta Saura Igual
Does anyone know how I can read from a .txt file the lines that are between two strings whose location is unknown? My problem is that I have a .txt file with data separated by a sentence, for example: 2.22 3.45 1.56 2.31 pattern 1 4.67 7.91 3.34 2.15 5.32 3.88 pattern 2 ... I do not know the

Re: [R] question

2003-11-19 Thread Prof Brian Ripley
Read the lines with readLines into a character vector Remove the lines you don't want Use read.table on a textConnection to the character vector If the file were very large, use an anonymous file() connection instead (but better use OS tools such as grep to clean up the file). On Wed, 19 Nov

Re: [R] question

2003-11-19 Thread alessandro . semeria
With scan and match (pattern1,pattern2,..) you should be able to build a function to perform what do you want. A.S. Alessandro Semeria Models and Simulations Laboratory Montecatini Environmental Research Center (Edison Group), Via Ciro Menotti 48, 48023 Marina di

Re: [R] question

2003-11-19 Thread Philippe Glaziou
Fuensanta Saura Igual [EMAIL PROTECTED] Saura Igual [EMAIL PROTECTED] wrote: Does anyone know how I can read from a .txt file the lines that are between two strings whose location is unknown? My problem is that I have a .txt file with data separated by a sentence, for example: 2.22 3.45

Re: [R] question

2003-11-19 Thread Peter Dalgaard
Philippe Glaziou [EMAIL PROTECTED] writes: Fuensanta Saura Igual [EMAIL PROTECTED] Saura Igual [EMAIL PROTECTED] wrote: Does anyone know how I can read from a .txt file the lines that are between two strings whose location is unknown? My problem is that I have a .txt file with data

Re: [R] question

2003-11-19 Thread Philippe Glaziou
Peter Dalgaard [EMAIL PROTECTED] wrote: My problem is that I have a .txt file with data separated by a sentence, for example: 2.22 3.45 1.56 2.31 pattern 1 4.67 7.91 3.34 2.15 5.32 3.88 pattern 2 ... I do not know the number of lines where these separating

Re: [R] question

2003-11-19 Thread Philippe Glaziou
Philippe Glaziou [EMAIL PROTECTED] wrote: Peter, I cannot see your point. sed can get rid of any pattern in a text file. Fuensanta's example seemed to show that the sentences (pattern 1, 2,...) were on separate lines from lines containing data, thus my approach. Another one closer to your awk

Re: [R] question

2003-11-19 Thread Peter Dalgaard
Philippe Glaziou [EMAIL PROTECTED] writes: Er, no, that wasn't the requirement. It's a job for awk or perl, e.g. #!/usr/bin/perl -n if (/pattern 1/){ $copy = 1; next; } if (/pattern 2/){ $copy = 0; } print if $copy; or awk '/pattern

RE: [R] question (and a suggestion)

2003-11-19 Thread Gabor Grothendieck
PROTECTED] To: [EMAIL PROTECTED] Subject: [R] question Does anyone know how I can read from a .txt file the lines that are between two strings whose location is unknown? My problem is that I have a .txt file with data separated by a sentence, for example: 2.22 3.45 1.56 2.31 pattern 1 4.67

Re: [R] question

2003-11-19 Thread Philippe Glaziou
Peter Dalgaard [EMAIL PROTECTED] wrote: blueberry:~/ sed -e 's/pattern 1\|pattern 2\|pattern xyz//g' tst.txt 2.22 3.45 1.56 2.31 4.67 7.91 3.34 2.15 5.32 3.88 blueberry:~/ awk '/pattern 1/{copy=1;next};/pattern 2/{copy=0};copy==1' tst.txt 4.67 7.91 3.34 2.15 5.32 3.88 blueberry:~/

Re: [R] question

2003-11-19 Thread Philippe Glaziou
Philippe Glaziou [EMAIL PROTECTED] wrote: I see and here is my (corrected) sed solution: cunegonde:~/tmp cat test 2.22 3.45 1.56 2.31 pattern 1 4.67 7.91 3.34 2.15 5.32 3.88 pattern 2 cunegonde:~/tmp sed -e '/pattern 1\|pattern 2/D' test 2.22 3.45 1.56 2.31 4.67 7.91 3.34 2.15

[R] Question regarding mosaicplot

2003-11-18 Thread Jean Vidal
I tried this : mosaicplot(stoc ~ q9r + segca,data=tmp2,color=T) : works fine. And now, this : mosaicplot(stoc ~ q9r + segca, data=tmp2, color=T, main=Big title) Error in model.frame(formula, rownames, variables, varnames, extras, extranames, : invalid variable type I'm probably stupid

Re: [R] Question regarding mosaicplot

2003-11-18 Thread Prof Brian Ripley
It is a bug (which has been seen before). Just use title to add the main title afterwards. On Tue, 18 Nov 2003, Jean Vidal wrote: I tried this : mosaicplot(stoc ~ q9r + segca,data=tmp2,color=T) : works fine. And now, this : mosaicplot(stoc ~ q9r + segca, data=tmp2, color=T, main=Big

[R] question about matrix

2003-11-12 Thread Mikyoung Jun
Hello, I have a few questions about matrix in R. Can we make a matrix whose elements are list? I would like to save two different values in each elements of matrix. If there is a package or something which can deal with complex numbers, that will do it too. Also, I am wondering whether there is

Re: [R] question about matrix

2003-11-12 Thread Thomas W Blackwell
Mikyoung - All answers are yes, but IMHO you are trying to be too clever with your data structure. Programming is *much* easier if you keep things simple. Specifically: (1) The function matrix() will happily build you a matrix of type list, with each element of the list occupying one cell

RE: [R] question about matrix

2003-11-12 Thread Gabor Grothendieck
,] is the the vector: c(A[2,1],B[2,1]) --- Date: Wed, 12 Nov 2003 11:41:17 -0600 (CST) From: Mikyoung Jun [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [R] question about matrix Hello, I have a few questions about matrix in R. Can we make a matrix whose elements are list? I would like to save two

[R] Question about computing offsets automatically

2003-11-06 Thread Louisell, Paul T.
Hi, I'm using R version 1.8.0 on Windows NT. When fitting a glm with Poisson random component and a log link, I frequently need to include an offset. Typically I use xtabs or table to get the counts for the contingency table, and then I use as.data.frame.table to create a data frame that I can

Re: [R] Question about computing offsets automatically

2003-11-06 Thread Marc Schwartz
On Thu, 2003-11-06 at 13:33, Louisell, Paul T. wrote: Hi, I'm using R version 1.8.0 on Windows NT. When fitting a glm with Poisson random component and a log link, I frequently need to include an offset. Typically I use xtabs or table to get the counts for the contingency table, and then I

[R] question

2003-11-05 Thread Fuensanta Saura Igual
Dear all, I was wondering if someone could tell me what function I must use to know how long a computing problem has taken using R, I mean, I want to know the amount of time R has need to compute some certain task that has developed. Could anyone answer this? Thanks

Re: [R] question

2003-11-05 Thread Marc Schwartz
On Wed, 2003-11-05 at 08:03, Fuensanta Saura Igual wrote: Dear all, I was wondering if someone could tell me what function I must use to know how long a computing problem has taken using R, I mean, I want to know the amount of time R has need to compute some certain task that has developed.

RE: [R] Question about the high dimensional density estimation

2003-11-03 Thread Liaw, Andy
From: Jason Turner [mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I found that the R package KernSmooth can deal with only 1D and 2D data. But now I have a collection of 4-dimensional data (x1,x2,x3,x4) and would like to estimate the mode of the underlying density. What can

Re: [R] Question about the high dimensional density estimation

2003-11-01 Thread Jason Turner
[EMAIL PROTECTED] wrote: Hi, I found that the R package KernSmooth can deal with only 1D and 2D data. But now I have a collection of 4-dimensional data (x1,x2,x3,x4) and would like to estimate the mode of the underlying density. What can I do about it ? The gss package might do what you

[R] question about optim

2003-10-31 Thread Mikyoung Jun
Hello, When we use optim and run into errors, such as generates NA/NaN/Inf, and the routine stops because of this error, is there a way to print the values of the argument of the functions where the error occurs? For example, I am doing minimizing negative log likelihood and when the optim

Re: [R] question about optim

2003-10-31 Thread Roger D. Peng
You might want to try using options(error = recover) or perhaps options(error = browser). -roger Mikyoung Jun wrote: Hello, When we use optim and run into errors, such as generates NA/NaN/Inf, and the routine stops because of this error, is there a way to print the values of the argument of

[R] Question about the high dimensional density estimation

2003-10-31 Thread hungy
Hi, I found that the R package KernSmooth can deal with only 1D and 2D data. But now I have a collection of 4-dimensional data (x1,x2,x3,x4) and would like to estimate the mode of the underlying density. What can I do about it ? Thanks a lot. -- Ying-Chao Hung Assistant Professor Graduate

[R] question about predictions with linear models

2003-10-01 Thread Rajarshi Guha
Hi, this question is probably very obvious but I just cant see where I might be going wrong. I'm using the lm() function to generate a linear model and then make predictions using a different set of data. To generate the model I do (tdata pdata are matrices of observations and parameters,

[R] Question in Using sink function

2003-09-16 Thread Yao, Minghua
Could anyone please explain to me why the following writes nothing into all.Rout file? If the for loop is removed, t.test output can be written into all.out. Thanks in advance. Minghua Yao .. zz - file(all.Rout, open=wt) sink(zz) for(i in 1:n) { Cy3-X[,2*i-1];

Re: [R] Question in Using sink function

2003-09-16 Thread Andrew C. Ward
Dear Minghua Yao, If you throw in a print() or two you'll get some output in your file. You could try print(t.test(Cy3, Cy5)) or whatever you actually want. Regards, Andrew C. Ward CAPE Centre Department of Chemical Engineering The University of Queensland Brisbane Qld 4072 Australia [EMAIL

Re: [R] Question in Using sink function

2003-09-16 Thread Prof Brian Ripley
Autoprinting does not work inside a for() {} loop, and you did not print anything. Try for(i in 1:10) {i} Did you try your problem without sink()? On Tue, 16 Sep 2003, Yao, Minghua wrote: Could anyone please explain to me why the following writes nothing into all.Rout file? If the for

RE: [R] Question in Using sink function

2003-09-16 Thread Yao, Minghua
, 2003 11:35 AM To: Yao, Minghua Cc: R Help (E-mail) Subject: Re: [R] Question in Using sink function Autoprinting does not work inside a for() {} loop, and you did not print anything. Try for(i in 1:10) {i} Did you try your problem without sink()? On Tue, 16 Sep 2003, Yao, Minghua wrote

RE: [R] Question in Using sink function

2003-09-16 Thread Prof Brian Ripley
On Tue, 16 Sep 2003, Yao, Minghua wrote: Thanks, Prof. Ripley. Right. I saw nothing, either, when I tried without for loop. Does anywhere in the documents mention that Autoprinting does not work inside a for() {} loop? It is in `An Introduction to R', albeit in a rather sophisticated

RE: [R] Question in Using sink function

2003-09-16 Thread Thomas Lumley
On Tue, 16 Sep 2003, Yao, Minghua wrote: Thanks, Prof. Ripley. Right. I saw nothing, either, when I tried without for loop. Does anywhere in the documents mention that Autoprinting does not work inside a for() {} loop? It's a FAQ. -thomas

[R] question regarding ks.test()

2003-09-15 Thread Rajarshi Guha
Hi, I'm using the ks.test() on two vectors. I looked up the reference and also coded up a version of the two sample Smirnov test. My question is that how can I decide from the output of R that the two vectors x y come from the same distribution? Am I correct in assuming that smaller D values

Re: [R] question regarding ks.test()

2003-09-15 Thread Uwe Ligges
Rajarshi Guha wrote: Hi, I'm using the ks.test() on two vectors. I looked up the reference and also coded up a version of the two sample Smirnov test. My question is that how can I decide from the output of R that the two vectors x y come from the same distribution? Strictly speaking,

Re: [R] question about simulation.

2003-08-21 Thread Uwe Ligges
Lily wrote: The problem has been solved. It is my mistake for not define the number of monte.carlo simulation when I am using mle.cv. Thank you all for your help! My last comment: It is your mistake not to specify required arguments, but there *is* a bug in wle. You should get an error message

Re: [R] question about simulation.

2003-08-20 Thread Uwe Ligges
Lily wrote: I am running a 1000 simulations, it works for 2 simulations. However, I get the following error message whenever I run it more than 3 times: The instruction at '0*11044080' referenced memory at o*3ff0. The memory could not be written. and, I can also get something like exception:

Re: [R] question about simulation.

2003-08-20 Thread Lily
Thanks for your response.I am working on R-1.7.1 under windows. Here is part of my code for simulation: x1-... y1-... beta-c(1,3,5,7,9)) mn-0 for ( i in 1:3) { e1-rnorm(40,mean=0,sd=1) y1-x1%*%beta+e1 result-mle.cv(y1~x1) result2-result[1, ] mn-rbind(mn, result2) } mn Thanks!! --- Uwe

Re: [R] question about simulation.

2003-08-20 Thread Spencer Graves
What version of R under what operating system with how much memory? What R functions are you using? Can you do a traceback()? Also, have you tried www.r-project.org - search - R site search? hope this helps. spencer graves Lily wrote: I am running a 1000 simulations, it works for 2

Re: [R] question about simulation.

2003-08-20 Thread Lily
The problem has been solved. It is my mistake for not define the number of monte.carlo simulation when I am using mle.cv. Thank you all for your help! --- Spencer Graves [EMAIL PROTECTED] wrote: What version of R under what operating system with how much memory? What R functions are you

[R] question for loop on matrix row level.

2003-08-19 Thread Lily
For the 1000 simulations, a matrix will be generated each time. And, I need to choose the first row of the generated matrix. The following loop doesn't work though: for (i in 1:1000) { aval[i]- matrixname[1,] } Any solution? thanks! __ [EMAIL

Re: [R] question for loop on matrix row level.

2003-08-19 Thread Spencer Graves
Have you considered making aval an array with the same number of columns as matrixname? Try the following: aval - array(NA, dim=c(2,2)) for(i in 1:2){ matrixname - array(i+(1:4), dim=c(2,2)) aval[i,] - matrixname[1,] } aval hope this helps. spencer graves Lily wrote: For the

Re: [R] Question about 'NA'

2003-08-14 Thread Jason Turner
Christian Mora wrote: Hi all, Ive got a database with 10 columns (different variables) for 100 subjects, each column with different # of NA's. I'd like to know if it is possible to use a function to exclude the NA's using only a specific column, lets say: Data2 - omit.exclude(Data1$column1) ??,

Re: [R] Question about 'NA'

2003-08-14 Thread Jerome Asselin
dat - data.frame(x=c(1,NA,2,2),y=c(3,2,NA,1)) dat dat[rownames(na.omit(dat[,y,drop=F])),] dat - data.frame(x=c(1,NA,2,2),y=c(3,2,NA,1)) dat x y 1 1 3 2 NA 2 3 2 NA 4 2 1 dat[rownames(na.omit(dat[,y,drop=F])),] x y 1 1 3 2 NA 2 4 2 1 HTH, Jerome On August 7, 2003 01:05 pm,

[R] Question about 'NA'

2003-08-10 Thread Christian Mora
Hi all, Ive got a database with 10 columns (different variables) for 100 subjects, each column with different # of NA's. I'd like to know if it is possible to use a function to exclude the NA's using only a specific column, lets say: Data2 - omit.exclude(Data1$column1) ??, then Data3 -

[R] question about formulating a nls optimization

2003-07-18 Thread Adi Humbert
Dear list, I'm migrating a project from Matlab to R, and I'm facing a relatively complicated problem for nls. My objective function is below: objFun - function(yEx,xEx,tEx,gamma,theta,kappa){ yTh - pdfDY(xEx,tEx,gamma,theta,kappa) sum(log(yEx/yTh)^2) } The equation is

Re: [R] question about formulating a nls optimization

2003-07-18 Thread Peter Dalgaard BSA
Adi Humbert [EMAIL PROTECTED] writes: Dear list, I'm migrating a project from Matlab to R, and I'm facing a relatively complicated problem for nls. My objective function is below: objFun - function(yEx,xEx,tEx,gamma,theta,kappa){ yTh - pdfDY(xEx,tEx,gamma,theta,kappa)

Re: [R] question about formulating a nls optimization

2003-07-18 Thread Douglas Bates
Adi Humbert [EMAIL PROTECTED] writes: I'm migrating a project from Matlab to R, and I'm facing a relatively complicated problem for nls. My objective function is below: objFun - function(yEx,xEx,tEx,gamma,theta,kappa){ yTh - pdfDY(xEx,tEx,gamma,theta,kappa) sum(log(yEx/yTh)^2)

Re: Data Frame (was: Re: [R] r-question

2003-07-13 Thread Spencer Graves
to read in a data set as a data frame from an external package? On Sat, 12 Jul 2003, dg gdf wrote: Date: Sat, 12 Jul 2003 22:09:59 -0700 (PDT) From: dg gdf [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [R] r-question I am student in Iran(IUT) that work on R software as my project. I need

Re: [R] question regarding GAM from a novice (in GAM as well as in R)

2003-07-12 Thread kjetil brinchmann halvorsen
On 12 Jul 2003 at 18:50, Tor A Strand wrote: Hei! Need to use generalized additive models and have therefore obtained R I am able to do the analysis but I have problems understanding the syntax and the options Can someone explain what some of the terms do in this model do:?

[R] r-question

2003-07-12 Thread dg gdf
I am student in Iran(IUT) that work on R software as my project. I need to some data frames in version 1.7.0, but these are not available. please help me. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] r-question

2003-07-12 Thread Marc R. Feldesman
At 10:09 PM 7/12/2003, dg gdf wrote: I am student in Iran(IUT) that work on R software as my project. I need to some data frames in version 1.7.0, but these are not available. please help me. __ It isn't clear exactly what help you need. We are most

[R] Question regarding irts class

2003-07-11 Thread Luis Torgo
I'm using the new irts class from package tseries which I find quite useful. However, I have data of different type being sample at irregular times (i.e. my data is more of a data frame than a matrix). Function irts that is used to create irts objects demands that the value component is either a

[R] question

2003-06-28 Thread Jan de Leeuw
Is it correct that lsfit(matrix(0,10,1),1:10,intercept=FALSE) returns zero residuals ? === Jan de Leeuw; Professor and Chair, UCLA Department of Statistics; Editor: Journal of Multivariate Analysis, Journal of Statistical Software US mail: 9432 Boelter Hall, Box 951554, Los Angeles, CA

Re: [R] question

2003-06-28 Thread Prof Brian Ripley
On Sat, 28 Jun 2003, Jan de Leeuw wrote: Is it correct that lsfit(matrix(0,10,1),1:10,intercept=FALSE) returns zero residuals ? No. I would use lm.fit for such problems, and that seems to behave (probably rather coincidentally). -- Brian D. Ripley, [EMAIL PROTECTED]

<    4   5   6   7   8   9   10   >