[R] apply function

2008-05-15 Thread Shubha Vishwanath Karanth
Hi R, Getting a strange result using ?apply. Please look into the below codes: d=data.frame(a=c(1,2,3),b=c(A,B,C),c=c(TRUE,FALSE,FALSE),d=c(T,F,F )) class(d[,1]) [1] numeric class(d[,2]) [1] factor class(d[,3]) [1] logical class(d[,4]) [1] logical apply(d,2,class)

Re: [R] apply function

2008-05-15 Thread Berwin A Turlach
G'day Shuba, On Thu, 15 May 2008 12:18:58 +0530 Shubha Vishwanath Karanth [EMAIL PROTECTED] wrote: Getting a strange result using ?apply. Please look into the below codes: d=data.frame(a=c(1,2,3),b=c(A,B,C),c=c(TRUE,FALSE,FALSE),d=c(T,F,F)) class(d[,1]) [1] numeric class(d[,2])

Re: [R] lattice: left-aligned text in strips?

2008-05-15 Thread RINNER Heinrich
Thanks for your help! I guess I could have thought for ages about this, and never would such a solution have come to my mind ;-) It works as far as the text in the strips is left-aligned; a remaining drawback is that printing of longer texts will be continued outside the right border of their

Re: [R] A very simple question

2008-05-15 Thread Erin Hodgess
Or k - c(1,1,1,2,2,1,1) k[!(k==3)] [1] 1 1 1 2 2 1 1 On Wed, May 14, 2008 at 1:59 PM, Julian Burgos [EMAIL PROTECTED] wrote: Try this: k=c(1,1,1,2,2,1,1,1) k[(k!=1)] [1] 2 2 k[(k!=2)] [1] 1 1 1 1 1 1 k[(k!=3)] [1] 1 1 1 2 2 1 1 1 Julian Shubha Vishwanath Karanth wrote: Hi

[R] Function for subset of cases/lines

2008-05-15 Thread Stefan Uhmann
Hi, I have a vector: q1-c(4660,5621,5629,8030,8080,8180,8501,8190,8370,8200) The following command gives me the mean of its elements: mean(q1) [1] 7346.1 What can I do to do the same for the variable 'height', but only for the cases/rows which have one of the elements of q1 as 'number':

[R] plotting predictions

2008-05-15 Thread Habib, Mohamed A F A M
I have the following model: m1.dis=arima(diff(diff(log(ts1),lag=12)),order=c(0,1,1),seasonal=list(order=c(0,1,1),period=12)) I would like to know how to plot the correct predictions in the original units because I am trying the following code but it is not working. I believe that there must be

Re: [R] Heatmap.2 - eliminate cluster and dendrogram

2008-05-15 Thread Matthias Kohl
Dear Peter, heatmap.2(z, dendrogram = none, Rowv = FALSE, Colv = FALSE) should do what you want. Best, Matthias Peter Scacheri wrote: Using the heatmap.2 function, I am trying to generate a heatmap of a 2 column x 500 row matrix of numeric values. I would like the 1st column of the matrix

[R] Zipf distribution fitting with VGAM

2008-05-15 Thread zhyzhou
Dear R users: I want to fit my data with zipf distribution using VGAM package, I used the following script: w-read.csv(the data file path) y-1:length(w) fit = vglm(y ~ 1, zipf(link=identity, init=0.5), tra=TRUE, weight=w) After run it, I encountered the problem :

Re: [R] Function for subset of cases/lines

2008-05-15 Thread Dimitris Rizopoulos
try this: q1 - c(4660,5621,5629,8030,8080,8180,8501,8190,8370,8200) dat - read.table(textConnection( number height 1 4660 2.5 2 5010 1.4 3 5621 0.8 4 5629 2.3 5 8030 2.5 6 8080 2.4 7 8090 0.9 8 8180 1.4 9 8501 1.2 10 8190 1.9 11 8200 2.0 12 8370 2.1 13 8200 1.8), header = TRUE)

Re: [R] Function for subset of cases/lines

2008-05-15 Thread Matthias Kohl
Dear Stefan, what about q1-c(4660,5621,5629,8030,8080,8180,8501,8190,8370,8200) x - data.frame(number = c(4660, 5010, 5621, 5629, 8030, 8080 , 8090, 8180, 8501, 8190, 8200, 8370, 8200), height = c(2.5, 1.4, 0.8, 2.3, 2.5, 2.4, 0.9, 1.4, 1.2, 1.9, 2.0, 2.1, 1.8)) ind - x[,number] %in% q1

Re: [R] A very simple question

2008-05-15 Thread Patrick Burns
There have been several solutions like: k[k != 3] The more general form of this idea is: k[!(k %in% 3)] Sticking closer to the original form would be: out - which(k == 3) if(length(out)) k[-out] else k Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S

Re: [R] Function for subset of cases/lines

2008-05-15 Thread Stefan Uhmann
Dear Dimitris, dear Matthias, thank you very much, I adapted the short solution you both provided - works as intended. And I have learned sth. once again. Regards, Stefan Dimitris Rizopoulos schrieb: try this: q1 - c(4660,5621,5629,8030,8080,8180,8501,8190,8370,8200) dat -

Re: [R] plotting predictions

2008-05-15 Thread Prof Brian Ripley
You appear to be doing the differencing twice. Do it only in arima, and not in the data you supply. On Thu, 15 May 2008, Habib, Mohamed A F A M wrote: I have the following model: m1.dis=arima(diff(diff(log(ts1),lag=12)),order=c(0,1,1),seasonal=list(order=c(0,1,1),period=12)) I would like

[R] R and C - variable by reference

2008-05-15 Thread Naira
Hi all, I would like to know if it is possible in R to give a the reference of a variable in a function; in order to be able to change the variable in the function and to keep the change when the function ended. In other words, is it possible to code this following C code in R: void

Re: [R] R and C - variable by reference

2008-05-15 Thread Duncan Murdoch
Naira wrote: Hi all, I would like to know if it is possible in R to give a the reference of a variable in a function; in order to be able to change the variable in the function and to keep the change when the function ended. In other words, is it possible to code this following C code in R:

Re: [R] lattice: left-aligned text in strips?

2008-05-15 Thread Charilaos Skiadas
On May 15, 2008, at 3:18 AM, RINNER Heinrich wrote: Thanks for your help! I guess I could have thought for ages about this, and never would such a solution have come to my mind ;-) It works as far as the text in the strips is left-aligned; a remaining drawback is that printing of longer

Re: [R] Using tapply

2008-05-15 Thread Chuck Cleland
On 5/15/2008 5:05 AM, Patrick Hausmann wrote: Dear list, I have a dataframe like this: w - c(1.2, 1.34, 2.34, 3.12, 2.43, 1.99, 2.01, 2.23, 1.45, 1.59) g - rep(c(a, b), each=5) df - data.frame(g, w) df df gw 1 a 1.20 2 a 1.34 3 a 2.34 4 a 3.12 5 a 2.43 6 b 1.99 7 b 2.01 8 b

[R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
Hi R, Suppose that SAS dataset 'tsubset1' is stored in the path, Z:/data. Then I give the below read.ssd() command to read SAS dataset, 'tsubset1.sas7bat' into R. library(foreign) s=read.ssd(Z:/data,tsubset1,sascmd = C:/Program Files/SAS/SAS 9.1/sas.exe) s A B C 1 3 4 5 2 6 7 8

Re: [R] Function for subset of cases/lines

2008-05-15 Thread Richard . Cotton
I have a vector: q1-c(4660,5621,5629,8030,8080,8180,8501,8190,8370,8200) The following command gives me the mean of its elements: mean(q1) [1] 7346.1 What can I do to do the same for the variable 'height', but only for the cases/rows which have one of the elements of q1 as

[R] Using tapply

2008-05-15 Thread Patrick Hausmann
Dear list, I have a dataframe like this: w - c(1.2, 1.34, 2.34, 3.12, 2.43, 1.99, 2.01, 2.23, 1.45, 1.59) g - rep(c(a, b), each=5) df - data.frame(g, w) df df gw 1 a 1.20 2 a 1.34 3 a 2.34 4 a 3.12 5 a 2.43 6 b 1.99 7 b 2.01 8 b 2.23 9 b 1.45 10 b 1.59 Using tapply to get

[R] Odp: is there any graphic function

2008-05-15 Thread Petr PIKAL
Hi one way is tu use arrows with code 3 and angle 90 the other is to use gplot or plotrix packages. See http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-base:errbars Regards Petr [EMAIL PROTECTED] 724008364, 581252140, 581252257 [EMAIL PROTECTED] napsal dne 14.05.2008 23:04:16:

[R] metaMDS using Dissimilarity matrix

2008-05-15 Thread Birgit Lemcke
Hello R-user community! I am running R 2.7.0 on a Power Book (Tiger). (I am still R and statistics beginner) Presently I try to run the function metaMDS (vegan) using an existing dissimilarity-matrix. As I would like to start with this matrix I thought I could just give the matrix

[R] weights and prior.weights

2008-05-15 Thread Paul Baverel
Dear all, I have a problem finding how to use properly prior.weights and weights options when performing a stepwise GAM analysis (gam and step.gam functions of GAM package) for covariate inclusions. The code I use is coming from the documentation and I do not get any error messages but not

[R] Inconsistent linear model calculations

2008-05-15 Thread e-letter
Readers, Using version 251 I tried the following command: lm(y~a+b,data=datafile) Resulting in, inter alia: ... coefficients (intercept) a 1.2 3.4 Packages installed: acepack ace() and avas() for selecting regression transformations adlift

[R] Units of Difference Between Two Dates

2008-05-15 Thread Tom La Bone
I would like all three of these calculations to give an answer in days (or at least the same units): as.POSIXct(1971-08-01 00:00:00) - as.POSIXct(1971-08-01 00:00:00) Time difference of 0 secs as.POSIXct(1971-08-01 12:00:00) - as.POSIXct(1971-08-01 00:00:00) Time difference of 12 hours

Re: [R] console from tcltk

2008-05-15 Thread Gabor Grothendieck
The terminal terminology seemed confusing at first but it appears to refer to launching R from a Windows cmd session and in that case, yes, it outputs to that Windows cmd session window (as opposed to the Rgui window) which seems sufficient. I did find it acts strangely when used in conjunction

[R] logistic transformation using nlminb

2008-05-15 Thread John Pitchard
Dear all, I want to find the optimal values of a vector, x (with 6 elements) say, satisfying the following conditions: 1. for all x=0 2. sum(x)=1 3. x[5]=0.5 and x[6]=0.5 For the minimisation I'm using nlminb and to satisfy the first 2 conditions the logistic transformation is used with box

Re: [R] Units of Difference Between Two Dates

2008-05-15 Thread Prof Brian Ripley
On Thu, 15 May 2008, Tom La Bone wrote: I would like all three of these calculations to give an answer in days (or at least the same units): as.POSIXct(1971-08-01 00:00:00) - as.POSIXct(1971-08-01 00:00:00) Time difference of 0 secs as.POSIXct(1971-08-01 12:00:00) - as.POSIXct(1971-08-01

Re: [R] Reading SAS data into R

2008-05-15 Thread Peter Dalgaard
Shubha Vishwanath Karanth wrote: Hi R, Suppose that SAS dataset 'tsubset1' is stored in the path, Z:/data. Then I give the below read.ssd() command to read SAS dataset, 'tsubset1.sas7bat' into R. library(foreign) s=read.ssd(Z:/data,tsubset1,sascmd = C:/Program

Re: [R] metaMDS using Dissimilarity matrix

2008-05-15 Thread Birgit Lemcke
Sorry for not translating, misspackaging (MASS) and not reading properly (zerodist). I would like to implement the weighting in distance() foo - function(x, method, ...) as.dist(distance(x = x, method = method, weights=vectorname)) This seems to work but it would

Re: [R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
Seems that it gets deleted But lemme try again by providing the arguments... Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: Peter Dalgaard

[R] Error in Scan question

2008-05-15 Thread David Kaplan
__ 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 provide commented, minimal, self-contained, reproducible code.

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread Douglas Bates
Did you happen to notice the part at the bottom of every message about provide commented, minimal, self-contained, reproducible code? Considering that the result you quote from 251 has 2 coefficients and the result from 171 has 3 coefficients one might contemplate the possibility that you are

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread Michael Kubovy
Hi, To get help with this problem, you will have to create an example that others can duplicate. That is why each message to the list says (at the bottom): PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

Re: [R] wavlet analysis

2008-05-15 Thread stephen sefick
http://ion.researchsystems.com/IONScript/wavelet/ sorry about the broken link above. I will have a look- I also found an R function that will plot close to what I want on a website I will compare the two and get back with everybody. thanks for all of the help. Stephen On Wed, May 14, 2008 at

Re: [R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
Hi Peter, Realized that the log files are generated only when there is an error. Here are my contents of the log file: libname src2rd 'Z:/data'; libname rd xport 'C:\DOCUME~1\SHUBHA~1.AMB\LOCALS~1\Temp\1\RtmpObHuqk\file323b4e45'; proc copy in=src2rd out=rd; select tsubset10 ; Shubha Karanth

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread e-letter
2008/5/15 Douglas Bates [EMAIL PROTECTED]: Did you happen to notice the part at the bottom of every message about provide commented, minimal, self-contained, reproducible code? Sorry, don't understand what that statement means in my context. Considering that the result you quote from 251 has

Re: [R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
After running the codes in the log file, I realized that this has something to do with SAS only... Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From:

Re: [R] Heatmap.2 - eliminate cluster and dendrogram

2008-05-15 Thread Peter Scacheri
Thanks Matthias, I tried that, but received the following error message: Error in image.default(1:nc, 1:nr, x, xlim = 0.5 + c(0, nc), ylim = 0.5 + : dimensions of z are not length(x)(+1) times length(y)(+1) -Peter At 10:18 AM +0200 5/15/08, Matthias Kohl wrote: Dear Peter,

Re: [R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
Oh!...Got that...A member in the RD library of SAS can contain only 8 characters in its filename. Since the variables 'tsubset1', 'tsubset2','tsubset9' had exactly 8 letters in the name, those files read properly and then onwards, since the number of letters/characters exceeded 8,

[R] Inconsistent linear model calculations

2008-05-15 Thread e-letter
Professor Kubovy As you instructed, below is the command terminal output: sessionInfo() R version 2.5.1 (2007-06-27) i586-mandriva-linux-gnu locale:

[R] ANOVA between linear models.

2008-05-15 Thread Richard Martin
Hi All, I'm accustomed to performing an ANOVA to aid in choosing between linear models (for example y~x or y~x+x^2), however with different models I can't seem to do it. I'm trying to fit an exponential model of the form ye^(bt). Below is a code snippet that highlights what I'm trying to do s =

Re: [R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
By RD library I mean the xport library... Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: Shubha Vishwanath Karanth Sent: Thursday, May 15, 2008

[R] value transformations in a vector

2008-05-15 Thread Juan Pablo Fededa
Dear contributors: I have vector A composed of numbers wich have values equal to 1 and different to 1. I want to transform de components with a value=1 to a component of value=0, and those with a value different to1, to a value=1. Then I want to take out the components=0. Thanks in advance,

[R] weights in GAM

2008-05-15 Thread Paul Baverel
I have a problem finding how to use prior.weights or weights options when performing a stepwise GAM analysis (gam and step.gam functions) for covariate inclusions. Thanks beforehand for references or help on how to handle these 2 options. -- Paul Baverel, MSc, PhD student Div. of

[R] Font settings in xfig

2008-05-15 Thread Robert
Hello I'm using the xfig-function in R to export figures in fig-format. To use these exported figures in LaTeX, I first run a fig2dev to get a pstex and pstex_t file. However, in order to get the right pstex_t file (that is, with the text of the original figure) I have to change the font and

[R] mixed effects models with nested factors

2008-05-15 Thread Luis Cayuela
Hi everybody, I am trying to fit a model with the lmer function for mixed effects. I have an experimental design consisting of 5 field plots. Each plot is divided in 12 subplots where the influence of three factors on the growing of tree seedlings is tested: (1) seed (1 = presence; 0 =

[R] Help

2008-05-15 Thread Jacob, Mody
Dear All: I am new in Linux and I have inherited a Linux redhat system with R Version 2.1.0 (2005-04-18) installed. Can somebody help me with step by step instructions to download the new version and install it? Thanks mjacob The contents of this communication, including any attachments,

[R] plot(summary) within quantreg package

2008-05-15 Thread Duccio -
Quantreg package allows to plot the summary of models derived by quantile regression at different taus. The plot shows the parameters variation by varying taus: intercept and slope (for a linear model). Together with these values even confidence intervals may be plotted, based on the threshold

Re: [R] Heatmap.2 - eliminate cluster and dendrogram

2008-05-15 Thread James W. MacDonald
heatmap.2(z, col = greenred(100), dendrogram = none, Rowv = FALSE) NULL isn't one of the accepted values for the dendrogram argument. See ?heatmap.2 Best, Jim Peter Scacheri wrote: Using the heatmap.2 function, I am trying to generate a heatmap of a 2 column x 500 row matrix of numeric

[R] How to remove autocorrelation from a time series?

2008-05-15 Thread Claudia D'Aniello
Dear R users, someone knows how to remove auto-correlation from a frequencies time series? I've tried by differencing (lag 1) the cumulative series (in order to have only positive numbers) , but I can't remove all auto-correlation. If it's useful I can send my db. x - #

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread Ben Bolker
e-letter inpost at gmail.com writes: 2008/5/15 Douglas Bates bates at stat.wisc.edu: Did you happen to notice the part at the bottom of every message about provide commented, minimal, self-contained, reproducible code? Sorry, don't understand what that statement means in my context.

Re: [R] mixed effects models with nested factors

2008-05-15 Thread Douglas Bates
On Thu, May 15, 2008 at 9:22 AM, Luis Cayuela [EMAIL PROTECTED] wrote: Hi everybody, I am trying to fit a model with the lmer function for mixed effects. I have an experimental design consisting of 5 field plots. Each plot is divided in 12 subplots where the influence of three factors on

[R] Adding columns to dataframe

2008-05-15 Thread Bert Jacobs
Hi, I have a dataframe SDF1 that looks like this: Char1 Char2 Char 3 W.2007.02 W.2007.09 W.2007.16 W.2008.13 AC1F1 F2 F3 AC2 F4 BC3 F5 F6 I have another dataframe

Re: [R] How to remove autocorrelation from a time series?

2008-05-15 Thread Ben Bolker
Claudia D'Aniello kikki_80 at yahoo.it writes: Dear R users, someone knows how to remove auto-correlation from a frequencies time series? I've tried by differencing (lag 1) the cumulative series (in order to have only positive numbers) , but I can't remove all auto-correlation. Take the

Re: [R] How to remove autocorrelation from a time series?

2008-05-15 Thread Dieter Menne
Claudia D'Aniello kikki_80 at yahoo.it writes: Dear R users, someone knows how to remove auto-correlation from a frequencies time series? I've tried by differencing (lag 1) the cumulative series (in order to have only positive numbers) , but I can't remove all auto-correlation. If it's

Re: [R] Help to Draw Plot

2008-05-15 Thread ermimi
Thank you very much for your help Don MacQueen Don MacQueen wrote: At 1:24 PM -0700 5/14/08, ermimi wrote: Patrick and Blay Thank you very much for help me, I have drawn in blue the axis Blay the solution that you give me for start in (-10,-10) and finish in (10,10) isn´t very well

Re: [R] plot(summary) within quantreg package

2008-05-15 Thread Dieter Menne
Duccio - ritchieblackmore72 at gmail.com writes: Quantreg package allows to plot the summary of models derived by quantile regression at different taus. .. Here the main code: model- rq(y~x,data=dataset, tau = 0.8:10/10) # here is the model model.summary- summary(model)

Re: [R] Font settings in xfig

2008-05-15 Thread Prof Brian Ripley
On Thu, 15 May 2008, Robert wrote: Hello I'm using the xfig-function in R to export figures in fig-format. To use these exported figures in LaTeX, I first run a fig2dev to get a pstex and pstex_t file. However, in order to get the right pstex_t file (that is, with the text of the original

Re: [R] Heatmap.2 - eliminate cluster and dendrogram

2008-05-15 Thread Matthias Kohl
Dear Peter, the call works for me; e.g. x - matrix(rnorm(100), ncol = 4) heatmap.2(x, dendrogram=none, Colv = FALSE, Rowv = FALSE) There seems to be something wrong with your matrix z ... Best, Matthias Peter Scacheri wrote: Thanks Matthias, I tried that, but received the following error

Re: [R] lattice: left-aligned text in strips?

2008-05-15 Thread Deepayan Sarkar
On 5/15/08, RINNER Heinrich [EMAIL PROTECTED] wrote: Thanks for your help! I guess I could have thought for ages about this, and never would such a solution have come to my mind ;-) It works as far as the text in the strips is left-aligned; a remaining drawback is that printing of

Re: [R] Attributes or list programming efficiency

2008-05-15 Thread Bert Gunter
Thankyou Brian (and others). Very useful information(as usual). -- Bert -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 14, 2008 10:29 PM To: Bert Gunter Cc: r-help@r-project.org Subject: Re: [R] Attributes or list programming efficiency On

[R] New Optimization task view on CRAN

2008-05-15 Thread Stefan Theussl
Dear all, Today we released a new task view on CRAN which deals with R packages closely related to the wide field of optimization. It can be found on http://cran.R-project.org/web/views/Optimization.html. The focus of this task view is on *General Purpose Continuous Solvers*, *Mathematical

[R] off topic

2008-05-15 Thread lamack lamack
Dear all, someone could explain why the following example is not a valid randomization scheme? Consider an experiment in which the six experimental units to be used are permanently fixed in a row and two treat- ments are to be randomly assigned to the units. (One can think of fruit trees or a

Re: [R] off topic

2008-05-15 Thread Charilaos Skiadas
On May 15, 2008, at 2:07 PM, lamack lamack wrote: Dear all, someone could explain why the following example is not a valid randomization scheme? Consider an experiment in which the six experimental units to be used are permanently fixed in a row and two treat- ments are to be randomly

Re: [R] Adding columns to dataframe

2008-05-15 Thread Bert Jacobs
Jim, The problem with your solution is that the columnames are not in the same order as in the dataframe SDF2 The dummy columns are just put at the end of the dataframe SDF1. I keep looking for a better solutions. Thx for the effort. Bert _ From: jim holtman [mailto:[EMAIL

Re: [R] Adding columns to dataframe

2008-05-15 Thread jim holtman
After constructing the new dataframe, you can always reorder the columns in any order that you want by creating a character vector of the order that you want and then using it as: mydf[my.ordered.names] You may have to give a better example of what the input and output would look like. On Thu,

[R] nlme function in S+ and R

2008-05-15 Thread d . lee
Greetings and Salutations, I was curious if anyone out there has had much experience with the nlme function in both S+ and R. Right now I am working on an HIV dataset and trying to fit a NLME model to the data, and the coefficients I get in S+ differ slightly from the coefficients in R: R model

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread e-letter
On 15/05/2008, Michael Kubovy [EMAIL PROTECTED] wrote: Hi, Your reply doesn't help you with your lm() problem. You need to show the problem with lm() as well. Your original message was unclear on what is wrong. The problem I have with lm() is that when I enter this command, I obtain

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread Kenn Konstabel
On Thu, May 15, 2008 at 3:05 PM, e-letter [EMAIL PROTECTED] wrote: Using version 251 I tried the following command: lm(y~a+b,data=datafile) Resulting in, inter alia: ... coefficients (intercept) a 1.2 3.4 [...] When using version 171 I entered the same command:

Re: [R] lattice histogram problem with integers values and nint

2008-05-15 Thread Charilaos Skiadas
Two comments. First of all, I don't see how you can be sure that if you specify 365 bins, then each bin will contain exactly one day. In order to do that, you need to know that each bin has width exactly 1, and you don't tell lattice to use such a width, so it is likely choosing something

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread Rolf Turner
On 16/05/2008, at 7:23 AM, e-letter wrote: Well, I sought a statistician who showed me how to do this task using mathematica. Despite advice otherwise, You are certainly getting bad advice! I am interested to learn how to perform this basic task using r because it's free and and

Re: [R] Font settings in xfig

2008-05-15 Thread Robert
If I edit the fig file with Xfig, I have to change the value of special flag to special and the font to a LaTeX font instead of a postscript font. If these changes are not made, the pstex_t file produced from fig2dev doesn't contain the text as it should. So if I input the pstex_t in a tex file,

[R] proto naming clash?

2008-05-15 Thread David Katz
Trying to learn Proto. This threw me: #startup r... library(proto) a - proto(x=10) a$x [1] 10 x - proto(x=100) x$x Error in get(x, env = x, inherits = TRUE) : invalid 'envir' argument Do I simply need to be careful to name proto objects and proto components uniquely? Is this the desired

Re: [R] value transformations in a vector

2008-05-15 Thread Peter Alspach
Juan Pablo Look at the results of: as.numeric(A!=1) and A[A!=1] HTH ... Peter Alspach -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Juan Pablo Fededa Sent: Friday, 16 May 2008 1:36 a.m. To: r-help Subject: [R] value transformations

Re: [R] nlme function in S+ and R

2008-05-15 Thread Bert Gunter
Derrick: 1. There are lots of people out here with such experience -- including the author of the software! 2. nlme fitting involves iterative procedures whose final value (if indeed, convergence to a final value occurs -- it certainly need not) depends on a) the initial value you start from;

Re: [R] proto naming clash?

2008-05-15 Thread Charilaos Skiadas
On May 15, 2008, at 1:24 PM, David Katz wrote: Trying to learn Proto. This threw me: #startup r... library(proto) a - proto(x=10) a$x [1] 10 x - proto(x=100) x$x Error in get(x, env = x, inherits = TRUE) : invalid 'envir' argument Do I simply need to be careful to name proto objects

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread e-letter
Below is direct copy from command terminals of both pcs (mandrake 92 with r 171; mandriva 2008 with r 251, respectively). R : Copyright 2003, The R Development Core Team Version 1.7.1 (2003-06-16) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under

Re: [R] Adding columns to dataframe

2008-05-15 Thread Bert Jacobs
Jim, I think I'm almost there. When I use your formula it works and I can get the job done, but I encounter the following problem uniq - setdiff(names(y), names(x)) OK x[uniq] - 0 OK x NOT

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread Charilaos Skiadas
On May 15, 2008, at 5:37 PM, e-letter wrote: Below is direct copy from command terminals of both pcs (mandrake 92 with r 171; mandriva 2008 with r 251, respectively). R : Copyright 2003, The R Development Core Team Version 1.7.1 (2003-06-16) R is free software and comes with ABSOLUTELY NO

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread Rolf Turner
On 16/05/2008, at 9:44 AM, Charilaos Skiadas wrote: This is exactly why we asked you for a reproducible example and full code. That last entry in the V6 column is 69.65667 in this case, but 66.27667 in the other cases. So you clearly are working with two slightly different dodgy files,

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread e-letter
Thank you to all you eagle eyes; amendment made accordingly and solved. Not sure how the difference occurred... [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] win.graph() with more than one Lattice plot

2008-05-15 Thread Paulo Cardoso
Thanks Duncan, I achieve this: grid.newpage() for(h in 1:9) { pushViewport(viewport(layout=grid.layout(3,3))) pushViewport(viewport(layout.pos.row=lin[h],layout.pos.col=colu[h])) print(xyplot(tmx[,h]~frequ|as.factor(as.numeric(spf)),groups=as.factor(blm), data=tmx,type=l, xlab=frequency

[R] SE of difference in fitted probabilities from logistic model.

2008-05-15 Thread Rolf Turner
I am fitting a logistic binomial model of the form glm(y ~ a*x,family=binomial) where a is a factor (with 5 levels) and x is a continuous predictor. To assess how much ``impact'' x has, I want to compare the fitted success probability when x = its maximum value with the fitted

Re: [R] Inconsistent linear model calculations

2008-05-15 Thread Kingsford Jones
Also, it's worth pointing out the reason for the numerical instability of the parameter estimates: the predictors are nearly collinear. (dubious - read.table('clipboard')) V1 V2V3V4V5 V6 V7 1 1 300 39.87 39.85 39.90 39.87333 9 2 2 400 45.16 45.23 45.17 45.18667

[R] Making slope coefficients ``relative to 0''.

2008-05-15 Thread Rolf Turner
I am interested in whether the slopes in a linear model are different from 0. I.e. I would like to obtain the slope estimates, and their standard errors, ``relative to 0'' for each group, rather than relative to some baseline. Explicitly I would like to write/represent the model as