Re: [R] Quantile Regression: Measuring Goodness of Fit

2006-10-29 Thread Anupam Tyagi
Hi Martin,

Efferz, Martin efferz at finance.uni-mainz.de writes:

 
 Hi,
 
 how to measure the goodness of fit, when using the rq() function of quantreg?
I need something like an R^2 for
 quantile regression, a single number which tells me if the fit of the whole
quantile process (not only for a
 single quantile) is o.k. or not. 
 Is it possible to compare the (conditional) quantile process with the
(unconditional) empirical
 distribution function? Perhaps with a Chi^2 or Kolmogorv-Smirnov Test?
 
 Thanks for feedback.
 
 Martin

Please see:

http://www.econ.uiuc.edu/~roger/research/rq/rq.html

Anupam.

__
R-help@stat.math.ethz.ch 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] Re : Book recommendation for newbie to stats and R?

2006-10-17 Thread Anupam Tyagi
Hi Kevin,

justin bem justin_bem at yahoo.fr writes:

 
 Exact reference is : 
  Wonnacot, T., Wonnacot, R., 
  Introductory Statistics for Business and Economics, 
  New York, 1990
 

Though now about R, a good book to read for analyzing non-experimental data (and
even experimental data) is Identification Problems in the Social Sciences by
Charles Manski. It is a small, clearly written book, with examples. Providing a
reasonable answer (including caveats) to the kind of typical problem you
described in your initial post will benefit from this. You should atleast
consider this an important supplement. See the link below. Anupam.
http://www.hup.harvard.edu/catalog/MANIDE.html

__
R-help@stat.math.ethz.ch 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] Review process for new packages

2006-10-17 Thread Anupam Tyagi
Hello,

Duncan Murdoch murdoch at stats.uwo.ca writes:

 
 On 10/17/2006 2:22 AM, Andreas Wittmann wrote:
  Hi all, 
  
  i'm currently working on a creditmetrics package which includes functions
for computing the credit risk
 model creditmetrics. I guess it would be finished in a few days. 
  
  My question now is, does there exist some review process before sending it
to ctan or is it reviewed after
 having sended it?
 
 There's no review process to decide whether your package is useful or 
 well-written.  If you want that kind of review you should submit it to 
 the Journal of Statistical Software.

Although, this is a sensitive issue, it is unfortunate that such review (or
comment, if that is a more suitable word) process is not available at R. Is it
possible to have some process where people can provide comments, even if it is
not a journal review. It can help in improving the quality of packages
submitted to R, in reducing bugs, or simply catching errors (coding and
non-coding) that the author may have over-looked by mistake. Will contributing
something to R, on provisional basis, and then asking for comments, and then
submitting a final version work? 

It may also help to require the author to include a mathematical description of
what has been submitted, if it is a statistical function. This be because most
new users find it difficult to read R code at the level of functions. They may
also not be familiar with the statistical concept, but may know about it
mathematically---because different disciplines have differentiated their
specialized terminology (with some variation) as discipline specific statistical
applications have evolved. I think this will make R more accessible to a wider
user-base. 
---Anupam.

__
R-help@stat.math.ethz.ch 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] grep function with patterns list...

2006-10-16 Thread Anupam Tyagi
Hi Stephane,

Stéphane CRUVEILLER scruveil at genoscope.cns.fr writes:
 is there a way to pass a list of patterns to the grep function? I
 vaguely remember something with %in% operator...

I think you are looking for the %in% and %nin% which are part of Design package,
and also in Hmisc library. You have to install and load these packages to access
these functions.

Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] R Graphics: Saving PDF and other formats from Windows Graphic Device for LaTeX

2006-10-04 Thread Anupam Tyagi
Hello, I can't seem to save (or find the default location) when I use the Window
Graphic Device's pull down menu. It does not seem to save to the directory I
have set using setwd(...). How do I make the pull down menu's work?

What is the best format to save R graphics for inclusion into a LaTeX documents?
I will use PdfTex, or LaTeX - PS - PsToPdf to generate the final PDF file.
Which is  likely to give the best graphics quality in the final PDF document?
The final graphs will be about 3x3 inch (fit in a column in two-column format).
I will be grateful if someone can share their experience.

Anupam.

__
R-help@stat.math.ethz.ch 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] R Graphics: Saving PDF and other formats from Win dows Graphic Device for LaTeX

2006-10-04 Thread Anupam Tyagi
Thanks. That worked. I am using the following to set-up the device:

pdf(sgr6100.pdf, horizontal=FALSE, onefile=FALSE, 
height=3, width=3, pointsize=6)

Reducing point-size below 6 does not seem to make any difference to 
the size of text and symbols. Any suggestions to get smaller font sizes?

I am using WinEdt with MikTeX set-up. 

Any suggestions about something, or some packages, 
that might improve graphics inclusion. 

Latex complains about the [scale...] part for any scale in 

\includegraphics[scale=1]{} 

and pauses. Suggestions will be appreciated about what is the best way to scale
R graphics for inclusion in LaTeX.

Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] Listing contents of .zip

2006-10-03 Thread Anupam Tyagi
Hi, how do I list the contents of a .zip archive before creating a connection
with unz to a file in the archive? Anupam.

__
R-help@stat.math.ethz.ch 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] plotting

2006-10-02 Thread Anupam Tyagi
Dieter Menne dieter.menne at menne-biomed.de writes:

  Is there something in R that will display both observed values and their
  influence on calculated statistics?
 
 In general : yes. You may give the example in the lm documentation a first
 try, and then rephrase your question.

Thanks for the pointer. I found what I was looking for in lm.influence and
influence.measures. I was looking for Cook's Distance some other influence
measures. I guess I want to plot the fitted values, observations and influence
measures on the same plot. Anupam.

__
R-help@stat.math.ethz.ch 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] pie() with only 180°

2006-10-01 Thread Anupam Tyagi
Thomas Steiner finbref.2006 at gmail.com writes:

 
 I want to plot the results of today's elections in Austria in this
 typical 180°-piechart (and not 360°).
 Unfortunantely pie() has just an argument init.angle and no end.angle.
 Perhaps you know a workaround.
 Thomas

Please look up the function fan.plot Jim Lemmon had posted last month in reply
to a question by me. You may be able to tweak that and make 180-degree plots.
Anupam.

__
R-help@stat.math.ethz.ch 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] if (NULL) is error?

2006-10-01 Thread Anupam Tyagi
Alberto Vieira Ferreira Monteiro albmont at centroin.com.br writes:

 Why this is not valid?
 
 test - NULL
 if (test) test

What are you trying to do with these statements? I think setting test to
False may do what you want. Of couse, I am just guessing. Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] plotting

2006-09-30 Thread Anupam Tyagi
Is there something in R that will display both observed values and their
influence on calculated statistics?
Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] Setting NA

2006-09-30 Thread Anupam Tyagi
Is there a way to set NA values in R, without changing the dataframe? I would
like to use different combinations of non-response values, as if they were NA
for some of the computations. I don't want to change the dataframe each time I
have to do this?
Anupam.

__
R-help@stat.math.ethz.ch 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] working with summarized data

2006-09-29 Thread Anupam Tyagi
Hi Rick,

I came across your posting that I had replied to. I had assumed from 
your posting that you had positive integer weights, and that you had a 
certain kind of stratified sampling. For a general case, you may want to 
look at survey package. Graphical representation of survey data, 
specially large surveys, is a good research issue in statistical 
graphics. R seems to be is suitable for doing this kind of work.

Anupam.

Anupam Tyagi wrote the following on 8/31/2006 10:40 AM:
 One solution is to simulate the population by repeating each row 
 weight number of times. This is inefficient. It may create a very 
 large dataset for a large sample survey. But some of graphs and other 
 things may turn out to your liking, depending upon how the functions are 
 written.
 
 Anupam.
 
 Rick Bischoff wrote the following on 8/30/2006 7:57 PM:
 The data sets I am working with all have a weight variable--e.g.,  
 each row doesn't mean 1 observation.

 With that in mind, nearly all of the graphs and summary statistics  
 are incorrect for my data, because they don't take into account the  
 weight.

 
 For example median is incorrect, as the quantiles aren't calculated  
 with weights:

 sum( weights[X  median(X)] ) / sum(weights)

 This should be 0.5... of course it's not.
 

 Unfortunately, it seems that most(all?) of R's graphics and summary  
 statistic functions don't take a weight or frequency argument.
 (Fortunately the models do...)

 Am I completely missing how to do this?  One way would be to  
 replicate each row proportional to the weight (e.g. if the weight was  
 4, we would 3 additional copies) but this will get prohibitive pretty  
 quickly as the dataset grows.


 Thanks in advance!

 __
 R-help@stat.math.ethz.ch 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.

 


__
R-help@stat.math.ethz.ch 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] working with summarized data

2006-09-29 Thread Anupam Tyagi
Thomas Lumley tlumley at u.washington.edu writes:

 
 On Wed, 30 Aug 2006, Rick Bischoff wrote:
 
  Unfortunately, it seems that most(all?) of R's graphics and summary
  statistic functions don't take a weight or frequency argument.
  (Fortunately the models do...)
 
  I have been been meaning to add this functionality to my graphics
  package ggplot (http://had.co.nz/ggplot), but unfortunately haven't
  had time yet.  I'm guessing you want something like:
 
  * scatterplot: scale size of point according to weight (can do)
  * bar chart: bars should have height proportional to weight (can do)
  * histogram: area proportion to weighting variable (have some half
  finished code to do)
  * smoothers: should automatically use weights
  * boxplot: use weighted quantiles/letter statistics (is there a
  function for that?)
 
  What else is there?
 
  densityplot is the only other one I can think of at the moment...
  With the rest of those, I could certainly live without it though!
 
 
 Density plots, scatterplot smoothers, hexbin plots, bubble plots, 
 histograms, and boxplots are available in the survey package. These are 
 probability-weighted rather than frequency-weighted but it doesn't matter 
 for graphics.  You could use them as is (which requires setting up a 
 survey design object) or rip the internals out of them.
 
   -thomas
 

I came across this posting that I had replied to earlier. I had assumed from the
original question that the data had positive integer weights, and that it had a
certain kind of stratified sampling. For a general case, survey package and
perhaps ggplots seem suitable to make these graphical extensions. survey
also takes into account survey design. I think graphical representation of
survey data,
specially large surveys, is a good research issue in statistical graphics. For
example, I am not convinced that making the area of a graphical symbol a
function of survey weight gives easily perceived and interpretable results: like
a bars in a bar-plot or histogram. Is there an implementation of graphical
functions that are conceptually similar to graphical respresntations of robust
statistics (which modify the weights of observations)? R seems to be suitable
for doing this kind of work.

Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] Extention of Pie Chart in R (was Re: Adding percentage to Pie Charts)

2006-09-26 Thread Anupam Tyagi
Jim Lemon jim at bitwrit.com.au writes:

 I admit to interpreting this pretty loosely, but I would like to know 
 what people think of a fan plot.

Hi all, I tried the fan.plots that Jim has been very nice to provide. It made me
think if there was something like, clock.plots in R? Something like the
following, anything that comes close? 

The idea an extention in yet another way of Pie Charts, extending the fan.plots
provided by Jim.
* A value will be depicted on a clock.plot using 1 or 2 hands of an analog
clock on a circle calibrated from 0 to 100 (same as 0).
* For values between 0 and 99 use the position of only one hand of the clock
(needle).
* For values of 100, use the second hand (needle), and move it to 1.
* Some way to identify needles, and two two overlapping needles.
* Use color coding or line-types to differentiate variables.

This is basically a clock calibrated on a scale of 100, rather than 60. It can
visually depict values between 1 and 1.

Do we have something like this R?

Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] read.xport: Writing and reading dataframe to disk directly

2006-09-26 Thread Anupam Tyagi
Hi All, is there a way of directly writing to disk file, the dataframe or list
of dataframes that result from read.xport function. This function converts SAS
export files to R dataframes. I would like to convert a SAS transport file to R,
but the resulting R dataframes do not fit in the memory of my computer. Is there
way to write the output of this fucntion to disk, perhaps using some pipe or
connection facility. Something like,

filexpt.lst - lookup.xport(file.xpt)
# works very well and returns a list with all kind of information about variable
# name, format, labels, etc.

save(filexpt.df - read.xport(file.xpt), file=filexpt.Rdata)
# from what I can tell, this will not work.

? Is there a way to use a pipe or connection to write filexpt.df to disk as it
is being created?
? Is there a way to use a connection to an R dataframe on disk, so I can get
subsets (rows or colums) from the dataframe on disk, without having to read it
into memory?

I will be thankful for your help and suggestions.

Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] colClasses: supressed 'NA'

2006-09-26 Thread Anupam Tyagi
Hi,

The colClasses seem to be supressing 'NA' vlaues. How do I fix this?

R script and first 5 lines of output is below.

File test2.dat has blanks that are read as NA when I do not use
'colClasses', but as blanks when I use 'colClasses'.

temp.df - read.fwf(test2.dat, width=c(10,1,1,1,1,2,2,3,3,1),  
col.names=c(psu,losewt,maintain,fewcal,phyact,age,income,weight,
wtdesire,gender),
colClasses=c(factor,factor,factor,factor,factor,numeric,factor,
numeric,numeric,factor),
nrows=27, comment.char=)

temp.df
   psu losewt maintain fewcal phyact age income weight wtdesire gender
1   2003009323  2252 05220  220  1
2   2003005181  21  2  2  58 08165  145  2
3   2003015942  21  4  1  76 05142  130  2
4   2003011406  21  3  1  43 03110  110  2
5   2003006786  1   4  1  49 06178  145  2

? why am I not getting missing values when I use 'colClasses'?

__
R-help@stat.math.ethz.ch 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] colClasses: supressed 'NA'

2006-09-26 Thread Anupam Tyagi
Uwe Ligges ligges at statistik.uni-dortmund.de writes:

 Well, you say it should be a factor, hence   is taken as a level. 

And why not   a level. Thanks for drawing my attention to it. It is common
mistake that is easy to slip attention. Thanks a lot. Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] Passing R connection as argument to a shell command on Windows

2006-09-25 Thread Anupam Tyagi
Hello, is there a way to pass a connection to a file in a zipped archive as
argument (instead of a file name of unzipped file) to shell command cut. In
general, is it possible to pipe output of a R function to a shell command? How?

I want to do something like:

z = unz(zipArchive.zip, fileASCII.ASC)
# open connection
open(z)
# cut lines of the ASCII file in zipped archive at specific postions and send
results to another file.
shell(cut -c2-3,5-8 z  test2.dat)

Anupam.

__
R-help@stat.math.ethz.ch 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] Adding percentage to Pie Charts

2006-09-25 Thread Anupam Tyagi
Gabor Grothendieck ggrothendieck at gmail.com writes:

 
 It might also be nice to be able to align the fans at the left or right,
 not just the center.

Fans that open only on one side: A line that moves like the minute needle of an
analog clock; with zero at the top. Movement of the needle in clock-wise
direction represents the number (precentage). Anupam.

__
R-help@stat.math.ethz.ch 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] Best use of LaTeX listings package for pretty printing R code

2006-09-25 Thread Anupam Tyagi
Frank E Harrell Jr f.harrell at vanderbilt.edu writes:

 
 This is what I have been using.  Does anyone have a better way?  In 
 particular I would like to see letters in comment strings not stretched 
 so much.  Thanks -Frank

It may be possible to pass on all comments to a verbatim like environment inside
the listings environment, by defining and redefining the preamble to listings. I
hope it does not interfere with something else in LaTeX. Anupam.

__
R-help@stat.math.ethz.ch 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] newie help needed

2006-09-21 Thread Anupam Tyagi
Julie Harold j.m.harold at uea.ac.uk writes:

 1.  is there a gui interface ?  How do we use it ?  R --gui just gets us
 to the command line.

Look at SciViews. Not a 100% menu driven GUI, but can be useful to new users.

 3.  can we define default directories - eg for data files ?

I think you can, because sys-admin at my former university did so some years
ago. May be using a symbolic link---I am not sure though.

 4.  we want to use this mainly in batch mode once we get our act
 together - are there any good examples of batch scripts we can use as
 crib sheets.

creating a new and simplified batch command for users may be helpful, rather
than allowing them to use the system batch, at or related commands.

__
R-help@stat.math.ethz.ch 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] looking for some functions to analyze a data set.

2006-09-20 Thread Anupam Tyagi
Taka Matzmoto sell_mirage_ne at hotmail.com writes:

 Hi R-users
 I have a data set. There are 10 products and the numbers of people who 
 ranked the products.
...
 
 Is there any other way I can summarize this data?

Be sure to know what assumptions are implicit in the procedures you are using to
do this. Any procedure you use will violate some assumption that seems quite
intutively appealing. Anupam.

__
R-help@stat.math.ethz.ch 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] Union of two data frames

2006-09-20 Thread Anupam Tyagi
Kartik Pappu kartik.pappu at gmail.com writes:

 Essentially, I want to make a union of the two data frames. I hope
 this question makes sense.

See merge(...), and have a look at R intro. Also check documentation for
Design package. Anupam.

__
R-help@stat.math.ethz.ch 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] Beginners manual for emacs and ess

2006-09-20 Thread Anupam Tyagi
Rainer M Krug rkrug at sun.ac.za writes:

 Is there anywhere a beginners manual for Emacs  ESS to be used with R? 
 even M-x S tells me it can't start S-Plus - obviously - but I want it to 
 start R...

Please also look at John Fox's Xemacs+ESS intro.
http://socserv.mcmaster.ca/jfox/Books/Companion/ESS/
Anupam.

__
R-help@stat.math.ethz.ch 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] Adding percentage to Pie Charts (was (no subject))

2006-09-20 Thread Anupam Tyagi
Greg Snow Greg.Snow at intermountainmail.org writes:

 Have you read the books by Cleveland?

I do not recall reading Cleveland's book; I have read one by Tufte. You raise
some interesting issues there. I agree with some, I could not clearly understand
some other things you mention. 

I think visual perception is aquired, in part. So if I were presenting data to
viewers who took carpentry or other such classes in highschool I may be tempted
to use dotcarts.

An interesting experiment: have kids compare pieces of pie or bread-sticks over
a dinner, and check how they do.  They should not have taken a carpentry class.
I use dot-charts, they are useful. Sometimes pie carts are useful too, because
people are so used to using and seeing them over a long time. Ofcourse, they can
be improved.

Also, it may be possible to put points of a dot-chart on a single straight line,
label them with a pointing line, and get better perception. There is poor
perception of the horizantal distance, by having to view that extra vertical
distance in a dotchart. However, it is useful to have the vertical axis in
Lattice plots, but not in stand-alone dot-charts.

Anupam.

__
R-help@stat.math.ethz.ch 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] Comparison of correlation coefficients

2006-09-19 Thread Anupam Tyagi
Peter Dalgaard p.dalgaard at biostat.ku.dk writes:

 No, he wants to compare two correlation coefficients, not test that
 one is zero. That's usually a misguided question, but if need be, the
 Fisher z transform atanh(r) can be used to convert r to an
 approximately normal variate with a known variance 1/(N-3) and
 comparing r1 and r2 from two independent samples is straightforward.
 The correlated case (like cor(x,y) vs cor(x,z)) is more complicated.

It seem the more complicated case is often of more substantive interest in many
settings: is children's income more strongly correlated with parent's education
than parent's income?

__
R-help@stat.math.ethz.ch 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] Adding percentage to Pie Charts (was (no subject))

2006-09-19 Thread Anupam Tyagi
Greg Snow Greg.Snow at intermountainmail.org writes:

 
 You may want to rethink your whole approach here:
 
 1. Pie charts are usually a poor choice of graph, there are better
 choices.
 2. Adding percentages to a pie chart is a way of admitting that the pie
 chart is not doing the job.
 3. If you want people to compare percentages, then a table is what is
 needed.
 4. A pie chart with percentages added is essentially a colorful but
 poorly layed out table.
 
 Consider using a dotplot instead of a pie chart, it changes the job of
 the viewer from comparing areas/angles (done poorly by humans) to
 comparing positions along a common scale (done well by humans).

I think dot charts (plots) are very useful, but they are not substitutes for a
pie chart: they do not show a comparison between the total and the individual
value; have a different scale (linear, usually), and are visually not suitable
to answer some questions that a pie chart can answer (is the value approximately
less than a fourth of the total? Is it less than half?). For some of these
questions, even dot-charts require a value label, or the user doing mental
calculations to guess approximations.

I think I am quite attuned to getting approximate fractions from a pie-chart in
shorter time, than on a linear scale like the dot-chart.

A modification in a pie chart that draws overlapping areas with a common start
point at the top of the circle, can make is more informative than a dot-chart.
Something like:
* Start drawing at the top of the circle, as zero (degree/area).
* Draw the representation of every value starting from the top, as zero,
representing it as a labled line from the center of the circle to the boundary
(can use colors where possible).
* Use two lables for the circular axis, inside one for percentages, outside for
values.

What is the simplest way to draw this in R?

Anupam.

__
R-help@stat.math.ethz.ch 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] Comparison of correlation coefficients

2006-09-19 Thread Anupam Tyagi
Anupam Tyagi AnupTyagi at yahoo.com writes:

 It seem the more complicated case is often of more substantive interest in 
 many
 settings: is children's income more strongly correlated with parent's 
 education
 than parent's income?

An even better example (same measurement scale)---Questions like this get asked
quite often in practice: Is a child's income/wealth more strongly correlated
with a parent's income than parent's wealth? And some variants. I think there is
some literature on inference on marginals and conditional distributions, and
bounds that may be useful: Search: James Heckman, Charles Manski.

Anupam.

__
R-help@stat.math.ethz.ch 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] multiple density function

2006-09-19 Thread Anupam Tyagi
march marcella.marinelli at uniroma1.it writes:

 
 
 Hi everybody
 I'm new in R so the question will be easy for you
 I'm running multiple density functions taking account of the following
 conditions:
 mean=seq(10,1,length=10)
 var=seq(3,1,length=10)
 
 How can I describe the density functions on the same chart?
 thanks
 Marcella

Hi Marcella, I am not sure of what you are specifically trying to do, but if you
want more than one set of points on the same graph (chart) use points after
plot. See examples in the graphics part of R documentation.
e.g.

 plot(...)
 points(...)
 
Anupam.

__
R-help@stat.math.ethz.ch 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] predict with logistic regression

2006-09-19 Thread Anupam Tyagi
Jan Sabee jan.sabee at gmail.com writes:

 I know that is probability of predict for new dataset.
 My question is how can I know each probability according to class (sore).
 I mean that I need the result of predit something like (M=1, F=0):
  1  2  3  4  5  6  7  8  9  10
  1  0  0  0  1  0  1  1  0   1

As I understand your question: you have the probability, and you can use these
to decide whether you think it is high enough for you to think whether it is M=1
or F=0. Anupam.

__
R-help@stat.math.ethz.ch 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] what does Height represent?

2006-09-19 Thread Anupam Tyagi
zhaoshi zhaoshi at u.washington.edu writes:

 
 hi--
 
 I am new to R and try to use R cluster my binary data. I use 
 hierarchical clustering
 plot (hclust (dist(x,method=binary),method=average),cex=0.1)
 I end up with a cluster Dendrogram. On the left of my dendrogram, there 
 is scale called Height from 0.0 to 1.0.
 I don't understand what does Height represent. If the Height represents 
 the distance scale between two different data point,
 it looks like if I add up the length of each branch, I end up with 
 distance of some pairs  1. It is not possible the distance
 between any data point will greater than 1. Could some help me out?

Hi zhaoshi, please check the documentation for the function using ?hclust. You
may also want to look at a book that uses R/S-plus for cluster analysis.
Venables and Ripley's Modern Applied Statistics with S-plus Chapter 11 may be
of some help. Anupam.

__
R-help@stat.math.ethz.ch 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] bubble plot problems

2006-09-19 Thread Anupam Tyagi
Pieter Provoost pieterprovoost at gmail.com writes:

 I'm having some problems with a bubble plot (ps package). I don't want 
 tick marks on all four sides (just two), I want to have a smaller font 
 size, and I would like to be able to define bubble sizes shown in the 
 legend (now it shows 0, 0, 0, 9.747 and 4265.757 which is not really 
 convenient. Passing some of the standard plot arguments didn't help (in 
 fact, nothing changed).

In general, bubble plots are not good visual aid, except when you happen to have
data for which they work well. They try to represent an additional dimention in
2-D, so there are bound to be problems if there is not enough space to do this
on a plot; additionally the scale is not linear, or something else we are use to
for comparing large differences (in case of your data). It may be better at
times to just label the data points, and let the reader choose the
interpretation, without representing relative size graphically. 

Please see a good book on Statistical Graphics.

http://www.math.yorku.ca/SCS/Gallery/

Search: Cleveland, and Tufte. 

Anupam.

__
R-help@stat.math.ethz.ch 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] FW: R Reference Card and other help (especially useful for Newbies)

2006-09-18 Thread Anupam Tyagi
Anupam Tyagi AnupTyagi at yahoo.com writes:

 
 New users may also want to look at SciViews R Graphical User Interface(GUI). 
 It
 can be a good learning tool. Its text based editor is basic compared to WinEdt
 with the R editing plug-in, or ESS and (X)Emacs combination. But it has
 point-and-click menus that help in writing code, and easy view of objects, etc
 can be very helpful for new users. Using this GUI may require you to install
 some R packages listed on the SciViews page.
 
 http://www.sciviews.org/SciViews-R/

A user may need to change the file target SciViews shortcuts points to. These
are added to Windows Start menu. This is needed for SciViews to work with the
intalled R version.

Use start menu to go to menu item SciViews-R. Go to R Console. Right click. Go
to last item in the list called properties. You will find something like the
following in the Target field

C:\Program Files\R\R-2.2.0\bin\Rgui.exe --sdi LANGUAGE=en RSciViews.RData

note the C:\R-2.2.0\...

It assumes that you have R-2.2.0 installaed in:

C:\Program Files\R\R-2.2.0

If your R installation is R-2.2.1, and is installed in

C:\Program Files\R\R-2.2.1

then you need to change the target of SciViews-R R console shortcut to:

C:\Program Files\R\R-2.2.1\bin\Rgui.exe --sdi LANGUAGE=en RSciViews.RData

note the change to: C:\R-2-2.1\...

note the LANGUAGE=en for English language GUI. You may be able to change this
to a language you want to use with R. See documentation for SciViews

__
R-help@stat.math.ethz.ch 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] Insert R code in LaTeX document

2006-09-17 Thread Anupam Tyagi
Alexandre Depire depire at gmail.com writes:

 
 Hello,
 i would like to insert R code in LaTeX document.
 I see something about the 'listings' package, but i would like if it is the
 best way and if it is possible to use the command \include{programme.R}.
 I have the following solution but it doesn't work with \include and \input

Following latex code worked for me. Anupam

\documentclass{report}
\usepackage{listings}
\begin{document}

Somethings .

\lstset{% general command to set parameter(s)
basicstyle=\small, % print whole in small
stringstyle=\ttfamily, % typewriter type for strings
numbers=left, % numbers on the left
numberstyle=\tiny, % Tiny numbers
stepnumber=2, % number every second line of code
numbersep=5pt, % 5pt seperation between numbering and code listing
language=R }

\lstinputlisting{text1.R}

\end{document}

__
R-help@stat.math.ethz.ch 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] Any other R users in Philadelphia?

2006-09-17 Thread Anupam Tyagi
Mitchell Maltenfort mmalten at gmail.com writes:

 I'm still new to R and wouldn't mind meeting other R users, at any
 level of experience.

This list is as good a place as any. Other is an R conference. There may also be
some undergrads at economics dept at UPenn. Anupam.

__
R-help@stat.math.ethz.ch 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] FW: R Reference Card and other help (especially useful for Newbies)

2006-09-17 Thread Anupam Tyagi
New users may also want to look at SciViews R Graphical User Interface(GUI). It
can be a good learning tool. Its text based editor is basic compared to WinEdt
with the R editing plug-in, or ESS and (X)Emacs combination. But it has
point-and-click menus that help in writing code, and easy view of objects, etc
can be very helpful for new users. Using this GUI may require you to install
some R packages listed on the SciViews page.

http://www.sciviews.org/SciViews-R/

Anupam.

__
R-help@stat.math.ethz.ch 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] Reading fixed column format

2006-09-13 Thread Anupam Tyagi
Gabor Grothendieck ggrothendieck at gmail.com writes:

 C:\bincut -c2-3,6-8 a.dat
 23678
 23678
 23678

Thanks. I think this will work. How do I redirect the output to a file on
windows? Is there simple way to convert the cut command to a script on windows,
because the entire command may not fit on one line? Anupam.

__
R-help@stat.math.ethz.ch 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] Reading fixed column format

2006-09-13 Thread Anupam Tyagi
Barry Rowlingson B.Rowlingson at lancaster.ac.uk writes:

  None of these seem to read non-coniguous variables from columns; or 
  may be I am missing something. read.fwf is not meant for large
  files according to a post in the archives. Thanks for the pointers. I
  have read the R data input and output. Anupam.
 
   First up, how 'large' is your 'large ASCII file'? How many rows and 
 columns?

There are 356,112 records, and 326 variables. It has a fixed record length of
1283 positions, therefore cut -b can not be used.
 
   Secondly, what are 'non-contiguous' variables?

When I do not want to read all columns. For example, I would like to read the
following:

StartingColumn  VariableNameFieldLength
1   STATE   2
24  INTVID  3
27  DISPCODE 3
30  PSU 10

Sometimes I would also like to format the data after it has been read. For
example, the ASCII file has price in columns 100 to 105 written as 005999. I
want to read this and format it as 59.99 (omitting leading zeros in the price).

   Perhaps if you posted the first few lines and columns of the file then 
 we might get an idea of how to read it in.

I have not even downloaded the data onto my computer yet, because I am not sure
I can read it in. The zipped file is 67MB. Using similar data a few years ago, I
recall the unzipped file to be about 350--400 MB. I had used MySQL then, but it
took some doing to get it in, and there were things that did not seem to work as
I wanted them to---I could not figure out how to label the variables. I usually
do not have to work with a dataframe of more than 10-30 MB at a time.

It would be good to have a facility in R which defines the meta-data: labelling
and structure of the dataset: positions of variables, their names, their lables,
their levels (e.g. for ordered choice or group variables: yes, sometimes, no
type responses). This can be saved as a seperate object and passed to a function
that gets the named varibales from the ASCII file (names of variables to get can
be given as arguments or as, attaches the meta data and creates a dataframe with
all the meta-data attached. The meta-data of the dataframe could include notes
at dataframe and variable level, and other information. This information is
passed on to the plotting functions and used when formatting the output of
statistical procedures.

I agree with with Michael Kobovy that this is a very helpful list, and people do
not owe less than what one paid for the software :)

Anupam.

__
R-help@stat.math.ethz.ch 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] Gnuplot epslatex format also in R?

2006-09-13 Thread Anupam Tyagi
Prof Brian Ripley ripley at stats.ox.ac.uk writes:

 
 R has an xfig driver, and AFAIK you can do this from xfig.
 

Is there an xfig port for Windows, without cygwin? If so, I will be thankful for
a pointer to the where it can be downloaded from. I have been looking for it for
some time. Anupam.

__
R-help@stat.math.ethz.ch 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] R-question

2006-09-13 Thread Anupam Tyagi
Thorsten Muehge MUEHGE at de.ibm.com writes:

 1. Is it possible to query R files by SQL internally on data frames (not on
 a database) and how is the syntax (I have the RODBC package installed).

It is possible to do similar things conceptually in R as in SQL---at least the
basic SQL queries (I have not tried others). Unlike SQL, R retains the sort
order. So far as I know you can not use SQL code to query R data-frames. But you
can put SQL code in a .R file and use RODBC or ODBC (I have used this) to send
SQL queries to database; you can also get the results from SQL queries back to R
as R objects.

__
R-help@stat.math.ethz.ch 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] Reading fixed column format

2006-09-13 Thread Anupam Tyagi
Barry Rowlingson B.Rowlingson at lancaster.ac.uk writes:

   Or if I'd just read Duncan's message about negative widths in read.fwf.
 
   Anyway, I've learnt about readLines() and seek() and reading zip files 
 now, so I can read _anything_

Thanks to everyone who answered my query. I have a lot to think about too.

__
R-help@stat.math.ethz.ch 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] Gnuplot epslatex format also in R?

2006-09-13 Thread Anupam Tyagi
Greg Snow Greg.Snow at intermountainmail.org writes:

 
 There is a Java based implementation called jfig at:
 http://tams-www.informatik.uni-hamburg.de/applets/jfig/ that works on
 windows.
 
 Hope this helps,
 

Thanks. Is there also a port of xv? It can be useful for some graphical
output. I tried Gimp on windows it did not do what I thought xv would have
done fine. Anupam.

__
R-help@stat.math.ethz.ch 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] Access Rows in a Data Frame by Row Name

2006-09-13 Thread Anupam Tyagi
I hope this helps.

 x - data.frame(a=1:5, b=6:10, d=11:15)
 x
  a  b  d
1 1  6 11
2 2  7 12
3 3  8 13
4 4  9 14
5 5 10 15
 # access row with name a. This does not work.
 x$a
[1] 1 2 3 4 5
 # access column with name d
 x$d
[1] 11 12 13 14 15
 x$row.names
NULL
 attributes(x)
$names
[1] a b d

$row.names
[1] 1 2 3 4 5

$class
[1] data.frame

 x$row.names()
Error: attempt to apply non-function
 row.names(x)
[1] 1 2 3 4 5
 # access first row by index
 x[1,]
  a b  d
1 1 6 11
 # access first row by name
 x[1,]
  a b  d
1 1 6 11
 # access second row by name
 x[2,]
  a b  d
2 2 7 12
 # change row names to alphabets.
 row.names(x) - c(a,b,c,d,e)
 row.names(x)
[1] a b c d e
 # access second row by old name. Does not work because of name change. 
 Why this does not give error: 2 row name does not exist?
 x[2,]
a  b  d
NA NA NA NA
 # access third row by name.
 x[c,]
  a b  d
c 3 8 13

__
R-help@stat.math.ethz.ch 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] inserting columns in the middle of a dataframe

2006-09-13 Thread Anupam Tyagi
I think it should be possible to create the column at the end and then use
order on the columns names and indexes to only change the order of column
indexes, rather than having to do operations on the data itself (which will be
very time consuming if the dataset is large). Perhaps people with better R
skills can suggest how to code this. Anupam.

__
R-help@stat.math.ethz.ch 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] Dear FE Harrell How can I get rreport ?

2006-09-13 Thread Anupam Tyagi
justin bem justin_bem at yahoo.fr writes:

 
 Mr Harrell,
 
  After reading discussion about R output and SAS output , I will like to use
rreport package. I a windows XP
 user 
 
  Sincerly

See:

http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/Rreport

Anupam.

__
R-help@stat.math.ethz.ch 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] rename cols

2006-09-12 Thread Anupam Tyagi
Christos Hatzis christos at nuverabio.com writes:

 
 Try this:
 
 old.colnames - colnames(my.439.vars.df)
 old.colnames[old.colnames==fksm] - new.name.a 
 old.colnames[old.colnames==klmk] - new.name.b

For a newcomer, it will be useful to have a function like this in the base R:
that can take a list of old.names and new.names, and do the assignment. It is
far more efficient to have functions that are shared via the R distribution,
than having to write own functions for carrying out basic data management tasks,
and simple routinely used statistical procedures. Most users would rather spend
time on thinking about the substantive work, instead of figuring out how to
program---this may be specially true for new users. This way the functions used
will also be more efficient and better designed than the typical new user.

__
R-help@stat.math.ethz.ch 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] Reading fixed column format

2006-09-12 Thread Anupam Tyagi
Jason Barnhart jasoncbarnhart at msn.com writes:

 
 These posts may be helpful.
 http://tolstoy.newcastle.edu.au/R/help/05/06/5776.html
 https://stat.ethz.ch/pipermail/r-help/2002-May/021145.html
 
 Using scan directly may also work for you rather than read.fwf.
 
 Also, there are posts regarding using other tools such a 'perl' or 'cut' to 
 prepocess the data
 before reading with R.  Searching the archives with those keywords should 
 help.

I new user should not have to learn perl,cut, awk, etc simply to be able
to use R. Does not make sense to me.

__
R-help@stat.math.ethz.ch 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] Reading fixed column format

2006-09-12 Thread Anupam Tyagi
Barry Rowlingson B.Rowlingson at lancaster.ac.uk writes:


  None of these seem to read non-coniguous variables from columns; or 
  may be I am missing something. read.fwf is not meant for large
  files according to a post in the archives. Thanks for the pointers. I
  have read the R data input and output. Anupam.
 
   First up, how 'large' is your 'large ASCII file'? How many rows and 
 columns?

There are 356,112 records, 326 variables, fixed record length of 1283 positions.
Zipped file is 42MB. There are no field (variable) separaters (delimiters).

   Secondly, what are 'non-contiguous' variables?

Variables that are not in adjoining positions in the file: reading them from the
file would require skipping columns while reading. For example, below are the
start positions of the first three variables I would like to read.

StartingColumn  VariableNameFieldLength
1   STATE   2
24  INTVID  3
30  PSU 10


   Perhaps if you posted the first few lines and columns of the file then 
 we might get an idea of how to read it in.

Because a record (row) of the file is 1283 columns, I would not like to post it
here.

Thank you for your response.

Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] Reading fixed column format

2006-09-11 Thread Anupam Tyagi
How can I read fixed column data (without a delimiter) from a large ASCII file
directly into R? I want to read non-contiguous variables. I am trying to avoid
reading it first into a DBMS and then choosing the variables. I would perfer to
format and label it along while reading if possible. Something like what STATA
does with dictionary. Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] Compress

2006-09-11 Thread Anupam Tyagi
How can I compress an R dataset so that it automatically chooses the optimal
data type: byte, integer, long, float, etc? Something like compress command
in Stata. Anupam.

__
R-help@stat.math.ethz.ch 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] Reading fixed column format

2006-09-11 Thread Anupam Tyagi
Jason Barnhart jasoncbarnhart at msn.com writes:

 
 Not familiar w/ Stata, but these functions read data files and should 
 provide the functionality you wish.
 ?read.fwf
 ?read.table
 ?scan

None of these seem to read non-coniguous variables from columns; or may be I am
missing something. read.fwf is not meant for large files according to a post
in the archives. Thanks for the pointers. I have read the R data input and
output. Anupam.

__
R-help@stat.math.ethz.ch 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] rename cols

2006-09-11 Thread Anupam Tyagi
Ethan Johnsons ethan.johnsons at gmail.com writes:

 
 A quick question please!
 
 How do you rename column names?  i.e. V1 -- Apple; V2 -- Orange, etc.

There are some nice utilities in Frank Harrell's Hmisc package. See:
http://lib.stat.cmu.edu/S/Harrell/help/Hmisc/html/upData.html
Also look at his Design library.

__
R-help@stat.math.ethz.ch 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] rename cols

2006-09-11 Thread Anupam Tyagi
For a newcomer who wants to rename variable fksm and klmk in a dataframe of
with 439 variables there is not easy and intuitive solution. That person has to
spend a lot of time listing columns and counting columns or doing string
searches or using brackets within brackets within brackets to get a simple thing
done. Is there a simple function or solution to this in R without using an
add-on package?

__
R-help@stat.math.ethz.ch 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.


[R] reading and formating irregular time series for VaR

2006-09-09 Thread Anupam Tyagi
Hi, I am trying to read the following type of data from a .csv file to form an
irregular time series object. I want to use it with the VaR package. How do I
read it in correctly to an irregular time series object? Anupam.

date,Open,High,Low,Close,Volume,OpenInterest,Contract
1972-08-16,54.25,54.25,54.25,54.25,1,1,KC1973H
1972-08-17,54.25,54.25,54.25,54.25,0,1,KC1973H
1972-08-18,54.25,54.25,54.25,54.25,0,1,KC1973H
1972-08-21,54.25,54.25,54.25,54.25,0,1,KC1973H
1972-08-22,54.25,54.25,54.25,54.25,0,1,KC1973H
1972-08-23,54.25,54.25,54.25,54.25,0,1,KC1973H

__
R-help@stat.math.ethz.ch 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] Multiple matrix multiplication with two 3-dimensional arrays

2006-09-08 Thread Anupam Tyagi
Sophie Baillargeon Sophie.Baillargeon at mat.ulaval.ca writes:


 Maybe I could use an apply or something but I 
 can't figure out how. I would have hoped that simply doing
 
 array1%*%array2
 
 would work, but it doesn’t…

I think one of the issues is that algebra for N-Dimentional arrays are not well
defined. Think how would you define the above operartion on two 3x3x3 arrays. I
had seen a paper a couple of years ago in some math journal that had proposed an
algebra. I will be interested in knowing a reference to some source that defines
3-dimentional array algebra. Then perhaps it could be implemented in R.

I will also be interested in knowing what is the equivalent of cell array in
MATLAB in R---that is something that is equivalent to the cell functions in a
spreadsheet---sometimes this can be useful.

Anupam.

__
R-help@stat.math.ethz.ch 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] working with summarized data

2006-09-01 Thread Anupam Tyagi
One solution is to simulate the population by repeating each row
weight number of times. This is inefficient. It may create a very
large dataset for a large sample survey. But some of graphs and other
things may turn out to your liking, depending upon how the functions are
written.

Anupam.

Rick Bischoff wrote the following on 8/30/2006 7:57 PM:
 The data sets I am working with all have a weight variable--e.g.,  
 each row doesn't mean 1 observation.
 
 With that in mind, nearly all of the graphs and summary statistics  
 are incorrect for my data, because they don't take into account the  
 weight.
 
 
 For example median is incorrect, as the quantiles aren't calculated  
 with weights:
 
 sum( weights[X  median(X)] ) / sum(weights)
 
 This should be 0.5... of course it's not.
 
 
 Unfortunately, it seems that most(all?) of R's graphics and summary  
 statistic functions don't take a weight or frequency argument.
 (Fortunately the models do...)
 
 Am I completely missing how to do this?  One way would be to  
 replicate each row proportional to the weight (e.g. if the weight was  
 4, we would 3 additional copies) but this will get prohibitive pretty  
 quickly as the dataset grows.
 
 
 Thanks in advance!
 
 __
 R-help@stat.math.ethz.ch 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.


__
R-help@stat.math.ethz.ch 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] Tables with Graphical Representations

2006-09-01 Thread Anupam Tyagi
First Graphic in the initial posting: I think this graphic need to be scaled in
a manner so it can be interpreted correctly while going across rows, columns, 
and
non-contguous cells, or the correct interpretation and way to read this
provided. For example, in the last row one has to read the numbers to
get the correct information out. I it will be good to have documentation that
explains how to read/interpret this graph, otherwise fixed length boxes are
visually confusing. Anupam.

__
R-help@stat.math.ethz.ch 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] Antwort: Buying more computer for GLM

2006-08-31 Thread Anupam Tyagi
Please look at http://boinc.berkeley.edu/

Your problem seems to be similar to the ones for which BOINC is used. I am not
sure how to do this with R, though. May be other people in this can help.

Anupam.

__
R-help@stat.math.ethz.ch 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.


[R] Grid Points

2006-08-20 Thread Anupam Tyagi
How do I put grid points (not grid lines) as the base layer of an xyplot? 

Is there a way to vary the interval at which x and y grid points are placed?

Is it possible to start a graph so that Y axis begins at 500 and ends at 800? I
am only interested in focusing on the relative distance between the points whose
values are between 500 and 800, but not their relative distance from zero.

Is there a way in R to draw two graphs so that that share the same X axis, but
without the gap that mfrow() creates? The origin of the top graph should be
where the Y-axis of the bottom graph ends. It will be useful for what I am
trying to do to have the X axis of the top graph be invisible.

Anupam.

__
R-help@stat.math.ethz.ch 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] split a y-axis to show data on different scales

2006-08-20 Thread Anupam Tyagi
I think information can be enhanced by using different scaled graphs next to
each other. mfrow() created too much space, there may be no need to again draw
the x-axis. It can be very useful to have different scales of the same data
presented next to each other, in addition to the main graph. So I think the data
of the person who started this thread could be displayed using one graph will
all the data, and then a superimposed graph (sharing same x-axis) on any part of
the data to give an enhanced visual communication. Drawing grid lines with same
tick marks in both graphs can enhance this visual communication. This is like
static zooming. Of course it is important to make sure that the change in
scale is evident, because it is needed for the interpretation of the
graph---using a grid with same tick marks can produce this effect visually. 

Anupam.

__
R-help@stat.math.ethz.ch 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] Grid Points

2006-08-20 Thread Anupam Tyagi
Thanks. How do I retain the same scale of grid.points
from one panel to next even if the scale of the data
changes? For example: c(seq(601:700),seq(6510,7000,
by=10)) ~ seq(601:700) | gl(2,50). 


--- Gabor Grothendieck [EMAIL PROTECTED]
wrote:

 Try this.  gl(2,50) is such that the first 50 points
 are series 1
 and the second 50 points are series 2.  The scales=
 argument
 defines the positions of the tick marks and the
 xlim= argument
 defines the x axis limits.  The layout puts the
 panels on top
 of each other rather than side by side.  strip =
 FALSE eliminates
 the strip above each panel.  type= says we want
 lines.  The
 panel function puts points at the grid locations in
 each panel
 and then calls xyplot to plot the lines.
 
 library(lattice)
 library(grid)
 
 x - 601:700
 at - seq(500, 800, 50)
 xyplot(x ~ x | gl(2, 50), scales = list(at = at),
 xlim = c(500, 700),
   layout = 1:2, strip = FALSE, type = l,
   panel = function(...) {
 grid.points(at, unit(rep(.01, length(at)),
 npc),
   pch = 20, size = unit(.2, char))
 panel.xyplot(...)
 })
 
 
 On 8/20/06, Anupam Tyagi [EMAIL PROTECTED]
 wrote:
  How do I put grid points (not grid lines) as the
 base layer of an xyplot?
 
  Is there a way to vary the interval at which x and
 y grid points are placed?
 
  Is it possible to start a graph so that Y axis
 begins at 500 and ends at 800? I
  am only interested in focusing on the relative
 distance between the points whose
  values are between 500 and 800, but not their
 relative distance from zero.
 
  Is there a way in R to draw two graphs so that
 that share the same X axis, but
  without the gap that mfrow() creates? The origin
 of the top graph should be
  where the Y-axis of the bottom graph ends. It will
 be useful for what I am
  trying to do to have the X axis of the top graph
 be invisible.
 
  Anupam.
 
  __
  R-help@stat.math.ethz.ch 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.
 


__
R-help@stat.math.ethz.ch 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] split a y-axis to show data on different scales

2006-08-19 Thread Anupam Tyagi
Johannes Hüsing hannes at ruhrau.de writes:

 
The pro's and con's of using scale breaks were discussed by
  Cleveland (1985) The Elements of Graphing Data (Wadsworth, pp. 85-91,
  149).  I don't know what Cleveland said about this is the second edition
 
 Spencer Graves:
  but I believe there are times when scale breaks are
  appropriate, but the display should make this nonstandard transition
  very clear;
 
 ... in which case you are close to having two graphs
 sharing an x-axis and therefore saving on ink (yay!).
 
 __
 R-help at stat.math.ethz.ch 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.
 
 

This is an interesting visual interpretation issue: it may be possible to shade
the y-axis (which his thick like the top bars in Lattice plots), or shade the
main graphing area from dark to light (or two shades, for two scales) to give a
visual idea about the density or stretch of the space/scale on which the
points are plotted. There is problems with this as well (interpretation of
scale), but sometimes it may provide a better and quick visual communication. Is
this possible in R?

__
R-help@stat.math.ethz.ch 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] Lattice package par.settings/trellis.par.settings questions

2006-08-17 Thread Anupam Tyagi
Please read about lattice.par.settings, and not trellis.par.settings. Trellis is
in S/S-plus. Anupam.

__
R-help@stat.math.ethz.ch 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] large dataset!

2006-07-03 Thread Anupam Tyagi
JENNIFER HILL jh1030 at columbia.edu writes:

 
 
 Hi, I need to analyze data that has 3.5 million observations and
 about 60 variables and I was planning on using R to do this but
 I can't even seem to read in the data.  It just freezes and ties
 up the whole system -- and this is on a Linux box purchased about
 6 months ago on a dual-processor PC that was pretty much the top
 of the line.  I've tried expanding R the memory limits but it 
 doesn't help.  I'll be hugely disappointed if I can't use R b/c
 I need to do build tailor-made models (multilevel and other 
 complexities).   My fall-back is the SPlus big data package but
 I'd rather avoid if anyone can provide a solution
 
 Thanks
 
 Jennifer Hill
 
Dear Jennifer, you may want to look at the R newsletters. A few years ago it had
an article on using DBMS with R, like MySQL, Oracle, etc. This is a frequently
asked question: There are also some posts over the past few years that may be
helpful. I have successfully read large database into MySQL, and accessed it
from R---it was larger than your database. I hope that helps. Anupam Tyagi.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] www.r-project.org

2006-04-26 Thread Anupam Tyagi
Gabor Grothendieck ggrothendieck at gmail.com writes:

 
 Maybe a separate web site that shows R off or maybe just
 a pointer to the R Graph Gallery.

I think the idea of a pointer to the R Graph Gallery is a better one than
changing the current R website. I think that the main R web site should be
accessible to as many users as possible, including those visually impaired. I
hope EmacsSpeaks Statistics (ESS) people will appreciate this suggestion. I do
like nice graphics and eye-candy. The other alternate could be an R-web site
that is simple and easily accessible as simple mark-up text, which can be speech
rendered. Anupam Tyagi.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The beautiful math plot

2006-04-26 Thread Anupam Tyagi
Gesmann, Markus Markus.Gesmann at lloyds.com writes:

 
 See:
 ?image

I would like to use this image in a publication. How do I get permission from
the creater of this image? Anupam Tyagi.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] help in R

2006-04-26 Thread Anupam Tyagi
Anamika Chaudhuri canamika16 at yahoo.com writes:

 
 Hi,
 
   I cant understand where I am going wrong.Below is my code.I would really 
 appreciate your help.

Dear Anamika, to improve your chances to get a response from this list, and to
help in people responde quickly and accurately to you, please run through your
code line-by-line and identify the line/lines where the problem is: even better
if you can broadly identify what the problem is. It will be difficult for
someone to replicate your programming problem, without having your dataset, and
knowing it's contents. Anupam.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html