[R] how to read this matrix into R

2004-11-05 Thread rongguiwong
the following the the lower.tri matrix in a file named luxry.car
and i want to  read it in R as a lower.tri matrix.how can i do?
i have try to use help.search("read"),but no result what i want.


  1.000 
  0.591  1.000 
  0.356  0.350  1.000  
 -0.098  0.072  0.380  1.000   
  0.573  0.408  0.382  0.062  1.000
  0.156  0.232  0.517  0.424  0.303  1.000 
  0.400  0.414  0.611  0.320  0.401  0.479  1.000  
  0.282  0.375  0.512  0.346  0.308  0.463  0.605  1.000   
  0.519  0.484  0.467  0.167  0.455  0.311  0.574  0.557  1.000

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


[R] any function for jackknife validation

2004-11-05 Thread rongguiwong
i want to using jackknife validation for a small sample to the PCA.is there 
any function for jacknife?i know splus has ,but i can not find in R.

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


[R] how to compute condition index?

2004-11-03 Thread rongguiwong
is there any existing function for computing condition index?
" analysing multivariate data" say that we can use condition index to check 
multicollinearity.saying that we can get it via SVD. The elements of the 
diagnoal matrix are the standard deviations of the uncorrelated vectors. the 
condition index is the ratio of the largest of these numbers to the smallest.
so if i have a data frame a,containg variables x,y,z.
my model is :
model<-lm(y~x+z,data=a)
so use the following to compute the condition index,but it seems wrong.

temp<-svd(model.matrix(model))$d
max(temp)/min(temp)

is it wrong?

__
[EMAIL PROTECTED] 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] `hist()' the weighted value

2004-10-25 Thread rongguiwong
how about
>hist(rep(x,w))
i think it works.

> I have the numeric vector `x' and the weights `w' for it of the same
> length. I'd like to have hist of `x' weighted with `w'.
> How to do that? I found nothing about weights in the hist help page..

__
[EMAIL PROTECTED] 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] Evaluate a function for various value of parameters

2004-10-22 Thread rongguiwong
ÔÚ 2004Äê10ÔÂ23ÈÕ ÐÇÆÚÁù 06:10£¬Stephane DRAY дµÀ£º
> Hello list,
>
> I have a problem ... and do not know how to solve it.
> I would like create a function that estimate the quality of the fit of
> different functions with different values of parameters.
> This problem is related to the following one:
> I would like to create a function "evaluatemyfunction" which evaluate a
> function f for different values of parameters. For instance, if
> f=function(a,b) a*b
> evaluatemyfunction(f,1:10,5) would return:
> 5
> 10
> 15...
> mapply("*",1:10,5)
 [1]  5 10 15 20 25 30 35 40 45 50
> outer(1:10,5,"*")
  [,1]
 [1,]5
 [2,]   10
 [3,]   15
 [4,]   20
 [5,]   25
 [6,]   30
 [7,]   35
 [8,]   40
 [9,]   45
[10,]   50
is these meet your need?
try
>?outer
>?mapply
to see more details.

__
[EMAIL PROTECTED] 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] R

2004-10-22 Thread rongguiwong
i think install.packages may help.
for example,if i want package car from www.cran.r-project.org
i can use 
>install.packages("car")
you can use ?install.packages to see more details.


ÔÚ 2004Äê10ÔÂ23ÈÕ ÐÇÆÚÁù 00:[EMAIL PROTECTED] дµÀ£º
> Hi, Everyone:
>
> We are installing R package in our Sun Solaris 9, and falling in trouble.
> We downloaded all package from bioconductor, the R can not be installed in
> Sun Solaris 9. We greatly appreciated if you could give us any suggestions.
> Thanks.
>
> Yours
>
> Song
>
> __
> [EMAIL PROTECTED] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

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


[R] how to study the code of R

2004-10-18 Thread rongguiwong
i want to study R programming by studying the existing code from R itself,but 
i don't know how to read the code,can any one give me some guide?
my R is installed in /usr/lib/R/

[EMAIL PROTECTED] ronggui]$ /usr/lib/R/
afm  bin  doc  etc  include  library  modules  share


> version
 _
platform i586-mandrake-linux-gnu
arch i586
os   linux-gnu
system   i586, linux-gnu
status
major1
minor9.1
year 2004
month06
day  21
language R
>

__
[EMAIL PROTECTED] 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] R 2.0.0 is released

2004-10-06 Thread rongguiwong
congratulations!

i download the software and install it.
it is pretty good.it start much more quickly than 1.9.1.
but i find a problem.
i have a data frame,the varible"PROVICE' is in Chinese,but it appears like 
this:
[1] \261\261\276\251   \314\354\275\362
 [3] \272\323\261\261   \311\275\316\367
 [5] \304\332\303\311\271\305   \301\311\304\376
 [7] \274\252\301\326   \272\332\301\372\275\255
 [9] \311\317\272\243   \275\255\313\325
[11] \325\343\275\255   \260\262\273\325
[13] \270\243\275\250   \275\255\316\367
[15] \311\275\266\253   \272\323\304\317
[17] \272\376\261\261   \272\376\304\317
[19] \271\343\266\253   \271\343\316\367
[21] \272\243\304\317   \326\330\307\354
[23] \313\304\264\250   \271\363\326\335
[25] \324\306\304\317   \316\367\262\330
[27] \311\302\316\367   \270\312\313\340
[29] \307\340\272\243   \304\376\317\304
[31] \320\302\275\256
31 Levels: ÉϺ£   ÔÆÄÏ   ÄÚÃɹŠ±±¾©   ¼ªÁÖ   ËÄ´¨   Ìì½ò   ÄþÏÄ   ... ºÚÁú½­

it seems can not display chinese correctly.but in R1.9.1,it display 
correctly .in R1.9.1,when i use >data$PROVICE,it display chinese directly,but 
in R2.0.0,the display numbers like "\261\261\276\251 ".
is it a bug or something else?

ÔÚ 2004Äê10ÔÂ4ÈÕ ÐÇÆÚÒ» 23:29£¬Peter Dalgaard дµÀ£º
> I've rolled up R-2.0.0.tar.gz a short while ago. This is a new version
> with a number of new features. See below for the details.
>
> As was the case with R 1.0.0, this new version represents a coming of
> age more than a radical change to R. We do plan to celebrate the new
> major version with press releases and such.
>
> The release will be available from
>
> http://cran.r-project.org/src/base/R-2/R-2.0.0.tar.gz
>
> or you might wait for it to be mirrored at a CRAN site nearer to you.
> Binaries for various platforms will appear in due course.
>
> There is also a version split for floppies.
>
>
> For the R Core Team
> Peter Dalgaard
>
>
>
>
> These are the md5sums for the freshly created files, in case you wish
> to check that they are uncorrupted:
>
> 3900bca37cabb4b76b8d736d51cc9251  R-2.0.0.tar.gz
> 4a3c7595b112d879997f7455fa8c1c0d  R-2.0.0.tar.gz-split.aa
> 45d376c7c533c62c657ef0fafac8a784  R-2.0.0.tar.gz-split.ab
> 7dbdb241e1fb7263701719ea856ebe41  R-2.0.0.tar.gz-split.ac
> 1e1077f7593778b79e9b0d5c676af63b  R-2.0.0.tar.gz-split.ad
> 6f4ffaa48a54e002f586f80fd4f2461c  R-2.0.0.tar.gz-split.ae
> 34b62bb31f6ecf84da329d21c2a21561  R-2.0.0.tar.gz-split.af
> c880f8f06ca3fe367bba6757e9cfbf32  R-2.0.0.tar.gz-split.ag
> b1a2d17d3ae523d04ffc8d3c6db4b67b  R-2.0.0.tar.gz-split.ah
>
>
> Here is the relevant part of the NEWS file
>
>
>   CHANGES IN R VERSION 2.0.0
>
>
> USER-VISIBLE CHANGES
>
> o The stub packages from 1.9.x have been removed: the library()
>   function selects the new home for their code.
>
> o `Lazy loading' of R code has been implemented, and is used for
>   the standard and recommended packages by default.  Rather than
>   keep R objects in memory, they are kept in a database on disc
>   and only loaded on first use.  This accelerates startup (down
>   to 40% of the time for 1.9.x) and reduces memory usage -- the
>   latter is probably unimportant of itself, but reduces
>   commensurately the time spent in garbage collection.
>
>   Packages are by default installed using lazy loading if they
>   have more than 25Kb of R code and did not use a saved image.
>   This can be overridden by INSTALL --[no-]lazy or via a field
>   in the DESCRIPTION file.  Note that as with --save, any other
>   packages which are required must be already installed.
>
>   As the lazy-loading databases will be consulted often, R
>   will be slower if run from a slow network-mounted disc.
>
> o All the datasets formerly in packages 'base' and 'stats' have
>   been moved to a new package 'datasets'.  data() does the
>   appropriate substitution, with a warning.  However, calls to
>   data() are not normally needed as the data objects are visible
>   in the 'datasets' package.
>
>   Packages can be installed to make their data objects visible
>   via R CMD INSTALL --lazy-data or via a field in the
>   DESCRIPTION file.
>
> o Package 'graphics' has been split into 'grDevices' (the graphics
>   devices shared between base and grid graphics) and 'graphics'
>   (base graphics).  Each of the 'graphics' and 'grid' packages
>   load 'grDevices' when they are attached.  Note that
>   ps.options() has been moved to grDevices and user hooks may
>   need to be updated.
>
> o The semantics of data() have changed (and were incorrectly
>   documented in recent releases) and the function has been moved
>   to package 'utils'.  Please read the help page carefully if
>   you use the 'package'

[R] want some materials about data manipulation.

2004-09-26 Thread rongguiwong
in the offical documnets,not much about data maniplution.
any one can give me some hints about data manipulation with R or awk or sed?
any help will be appreciated.
i want to tranfer from windows to linux,but when i deal with data 
manipulation,i have to turn to windows,i hope i can do my job under MDK linux 
whole.

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


[R] can I get these result with R?

2004-09-23 Thread rongguiwong
i want to check if the previously stock of social capital  has impact on the 
present economoc performace.so i get the following variables:economic 
performace ,stock of socail capital ;each of them from year 1996 to 2002,from 
30 different areas.
the data as following:
performance   stockyearereas
12,321996 1
11 12 1996 2
123  34   1996 3
¡­¡­¡­¡­¡­¡­
12,3321997 1
11 212 1997 2
123  32   1997 3
¡­¡­¡­¡­
13,2322002 1
12 212 2002 2
1233  2002 3

so i want to see if the 
1/stock[1996],stock[1997],stock[1998],stock[1999],sotck[2000],stock[2001],stock[2002] 
has impact on performance[2002]?
2/stock[1996],stock[1997],stock[1998],stock[1999],sotck[2000],stock[2001] has 
impact on performance[2001],
3/stock[1996],stock[1997],stock[1998],stock[1999],sotck[2000], has impact on 
performance[2000],
¡­¡­
and to see if the 
1/performace of year 1996,1997,1998,1999,2000,2001 has impact on performace of 
year 2002,
2/performace of year 1996,1997,1998,1999,2000 has impact on performace of year 
2001,
1/performace of year 1996,1997,1998,1999, has impact on performace of year 
2000,
¡­¡­

arima model seems not work,as i have data from 31 eareas,and i want to see if 
the differeces in economic performace of differenct areas has relation to the 
differences in the stock of social capital in each areas.
is it impossible mission?
any help will be appreciated.

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


[R] how to do jaccknife validation with R

2004-09-21 Thread rongguiwong
i can only find jackknife validation after boot.
but this may be not the things i want.

__
[EMAIL PROTECTED] 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] how to take this experiment with R?

2004-09-20 Thread rongguiwong
ÔÚ 2004Äê9ÔÂ21ÈÕ ÐÇÆÚ¶þ 12:10£¬Gabor Grothendieck дµÀ£º
it works.
but i come across anather problem.
i just wnat to select 3 of the best indepent variables.
but the reslut from  step(lm(X1 ~., x)) is :

Step:  AIC= -37.64
 X1 ~ X2 + X3 + X4 + X8 + X10 + X11 + X13 + X14 + X15 + X18 +
X21 + X22 + X25 + X26 + X27 + X29 + X30 + X31
 
   Df Sum of Sq RSS AIC
   11.014 -37.642
- X81 0.559  11.574 -37.165
- X27   1 0.867  11.881 -35.853
- X21 0.971  11.986 -35.416
- X18   1 0.978  11.992 -35.390
- X31   1 1.122  12.136 -34.793
- X10   1 1.400  12.414 -33.659
- X15   1 1.563  12.578 -33.005
- X29   1 1.608  12.622 -32.828
- X13   1 1.805  12.819 -32.055
- X30   1 1.880  12.894 -31.763
- X41 2.368  13.382 -29.906
- X14   1 2.495  13.509 -29.433
- X31 2.983  13.997 -27.659
- X22   1 2.999  14.013 -27.600
- X21   1 3.377  14.391 -26.271
- X25   1 4.323  15.338 -23.086
- X11   1 6.775  17.789 -15.672
- X26   1 7.232  18.246 -14.403

> You can express your model like this:
>
>
>
>lm(X1 ~., x)
>
>
>
> ?formula gives some help on formulas although the . notation
>
> above does not seem to be referred to there.
>
>
>
>
>
> Date: Tue, 21 Sep 2004 11:52:04 +0800
>
> From: rongguiwong <[EMAIL PROTECTED]>
>
> To:   <[EMAIL PROTECTED]>
>
> Subject:  [R] how to take this experiment with R?
>
>
>
> i want to generate 30 independent variables and 1 dependent variable,each
> has
>
> 50 draws from a unit normal distribution.
>
> then, searching for the independent variables that together would do the
> best
>
> job for fitting the denpendent variabe.
>
>
>
> my way to generate the data is.
>
> x<-data.frame(matrix(rnorm(1550),c(50,31)))
>
> but is there more better way to do it?
>
>
>
> i want to use the followling is to search the model.
>
> model<-step(lm(X1~X2+X3+X4.))
>
> but i don't know the to express the formula with lm function.i think there
> is
>
> a way the express it efficently.
>
> i try ?lm .but on result be found.
>
>
>
> any help is welcome!
>
>
>
>
>
> ___
> No banners. No pop-ups. No kidding.

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


[R] how to take this experiment with R?

2004-09-20 Thread rongguiwong
i want to generate 30 independent variables and 1 dependent variable,each has 
50 draws from a unit normal distribution.
then, searching for the independent variables that together would do the best 
job for fitting the denpendent variabe.

my way to generate the data is.
x<-data.frame(matrix(rnorm(1550),c(50,31)))
but is there more better way to do it?

i want to use the followling is to search the model.
model<-step(lm(X1~X2+X3+X4.))
but i don't know the to express the formula with lm function.i think there is 
a way the express it efficently.
i try ?lm .but on result be found.

any help is welcome!

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