Re: [R] Error unary operator

2012-10-29 Thread peter dalgaard

On Oct 30, 2012, at 05:34 , Jean Jang wrote:

> Hi R - listers,
> 
> I am receiving an error. Does anyone know what this means? J
> 

This command:

> ggplot(subset(foo, Rayos != "Rayos.NA"), aes(x=HTL, y=DevelopIndex,
> colour=TotalEggs)) +geom_point() +geom_jitter() +  
> facet_grid(Aeventexhumed ~ Rayos)

... ends here.

This command:

> + geom_smooth(method="lm", fill=NA) + ylim(c(0, 7))

makes no sense in isolation. Hence

> Error in +geom_smooth(method = "lm", fill = NA) :
>   invalid argument to unary operator

I suppose the + wants to be on the preceding line.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
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] changing date by +/- days

2012-10-29 Thread arun
Hi,
Try this:
dat1<-structure(1243792800, class = c("POSIXct", "POSIXt"), tzone = "GMT")
 dat2<-as.POSIXlt(dat1)
 dat2$mday<-dat2$mday-10
 dat2
#[1] "2009-05-21 18:00:00 GMT"
A.K.





- Original Message -
From: chuck.01 
To: r-help@r-project.org
Cc: 
Sent: Monday, October 29, 2012 8:37 PM
Subject: [R] changing date by +/- days

Hi, 
Let say I have a date variable like this:

structure(1243792800, class = c("POSIXct", "POSIXt"), tzone = "GMT")
[1] "2009-05-31 18:00:00 GMT"

How can I make it 10 days prior, so:
[1] "2009-05-21 18:00:00 GMT"

I'm randomly selecting dates from a list  and want a  second value a set #
of days either before or after. 

Thanks ahead of time. 



--
View this message in context: 
http://r.789695.n4.nabble.com/changing-date-by-days-tp4647803.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


__
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] Error unary operator

2012-10-29 Thread Jeff Newmiller
a) not reproducible, read the posting guide
b) there is actually a forum dedicated to ggplot2 where you would get better 
answers
c) I have not had luck providing an expression as the data argument to ggplot.
---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

Jean Jang  wrote:

>Hi R - listers,
>
>I am receiving an error. Does anyone know what this means? J
>
>ggplot(subset(foo, Rayos != "Rayos.NA"), aes(x=HTL, y=DevelopIndex,
>colour=TotalEggs)) +geom_point() +geom_jitter() +  
>facet_grid(Aeventexhumed ~ Rayos)
>+ geom_smooth(method="lm", fill=NA) + ylim(c(0, 7))
>
>
>Error in +geom_smooth(method = "lm", fill = NA) :
>   invalid argument to unary operator
>   [[alternative HTML version deleted]]
>
>__
>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.

__
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] GTK_2.18.5-X11.pkg

2012-10-29 Thread David Winsemius

On Oct 29, 2012, at 12:39 PM, Cory Lowe wrote:

> Does anyone know where I can download the GTK_2.18.5-X11.pkg? It has been 
> removed from r.research.att.com/libs/

If it ever was there, it can now be found here:

http://r.research.att.com/


> and I need it to use the RQDA package on my mac. Is there anyone who can 
> direct me to someone who might have the file? Any help would be greatly 
> appreciated.  
> - Cory
> __
> 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.

David Winsemius, MD
Alameda, CA, USA

__
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.


[R] Error unary operator

2012-10-29 Thread Jean Jang
Hi R - listers,

I am receiving an error. Does anyone know what this means? J

ggplot(subset(foo, Rayos != "Rayos.NA"), aes(x=HTL, y=DevelopIndex,
colour=TotalEggs)) +geom_point() +geom_jitter() +  
facet_grid(Aeventexhumed ~ Rayos)
+ geom_smooth(method="lm", fill=NA) + ylim(c(0, 7))


Error in +geom_smooth(method = "lm", fill = NA) :
   invalid argument to unary operator
[[alternative HTML version deleted]]

__
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] Interaction

2012-10-29 Thread Bert Gunter
On Mon, Oct 29, 2012 at 7:09 PM, Jeff Newmiller
 wrote:
> I thought addition was commutative. I am puzzled by your question.

1. This is not addition. These are model fomulae.

2, The model fitting function is unspecified by the OP. What is it? lm()?

3. In general, the coefficients should not depend on the order of the
coefficients,  However, inference will (sums of squares, etc.).

Cheers,
Bert

> ---
> Jeff NewmillerThe .   .  Go Live...
> DCN:Basics: ##.#.   ##.#.  Live Go...
>   Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
> /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
> ---
> Sent from my phone. Please excuse my brevity.
>
> Silvano Cesar da Costa  wrote:
>
>>Hi,
>>
>>I'm fitting a model with 3 variables: A, B and SNP.
>>The response variable is Y.
>>
>>I would like fit the following model, in this order:
>>
>>Y ~ A + B + A*B + SNP
>>
>>In general, the R sets of the form:
>>
>>Y ~ A + B + SNP + A*B
>>
>>How do this?
>>
>>
>>-
>>Silvano Cesar da Costa
>>
>>Universidade Estadual de Londrina
>>Centro de Ciências Exatas
>>Departamento de Estatística
>>
>>Fone: (43) 3371-4346
>>
>>__
>>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.
>
> __
> 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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

__
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] MANCOVA

2012-10-29 Thread Jorge I Velez
Check this out:http://en.wikipedia.org/wiki/Web_search_engine   --JIV


On Mon, Oct 29, 2012 at 7:03 PM, paola  wrote:

> What is this??
>
> paola
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/MANCOVA-tp4647735p4647737.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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.
>

[[alternative HTML version deleted]]

__
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] MANCOVA

2012-10-29 Thread Pascal Oettli

Hello,

Google, Yahoo!, Baidu, Bing, Yandex, Ask, AOL...

Regards,
Pascal


Le 29/10/2012 17:03, paola a écrit :

What is this??

paola



--
View this message in context: 
http://r.789695.n4.nabble.com/MANCOVA-tp4647735p4647737.html
Sent from the R help mailing list archive at Nabble.com.

__
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.



__
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] Interaction

2012-10-29 Thread Jeff Newmiller
I thought addition was commutative. I am puzzled by your question.
---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

Silvano Cesar da Costa  wrote:

>Hi,
>
>I'm fitting a model with 3 variables: A, B and SNP.
>The response variable is Y.
>
>I would like fit the following model, in this order:
>
>Y ~ A + B + A*B + SNP
>
>In general, the R sets of the form:
>
>Y ~ A + B + SNP + A*B
>
>How do this?
>
>
>-
>Silvano Cesar da Costa
>
>Universidade Estadual de Londrina
>Centro de Ciências Exatas
>Departamento de Estatística
>
>Fone: (43) 3371-4346
>
>__
>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.

__
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] changing date by +/- days

2012-10-29 Thread Jeff Newmiller
I try to use difftimes as much as possible.  For example,

oneday <- as.difftime( 24, units="hours" )
sometime - 10 * oneday

You might also find the lubridate package useful.
---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

"chuck.01"  wrote:

>got it, sorry!
>
>structure(1243792800, class = c("POSIXct", "POSIXt"), tzone =
>"GMT")-(60*60*24*10)
>
>
>
>
>chuck.01 wrote
>> Hi, 
>> Let say I have a date variable like this:
>> 
>> structure(1243792800, class = c("POSIXct", "POSIXt"), tzone = "GMT")
>> [1] "2009-05-31 18:00:00 GMT"
>> 
>> How can I make it 10 days prior, so:
>> [1] "2009-05-21 18:00:00 GMT"
>> 
>> I'm randomly selecting dates from a list  and want a  second value a
>set #
>> of days either before or after. 
>> 
>> Thanks ahead of time.
>
>
>
>
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/changing-date-by-days-tp4647803p4647804.html
>Sent from the R help mailing list archive at Nabble.com.
>
>__
>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.

__
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.


[R] replace repeated id in a pedigree list

2012-10-29 Thread Roberta Carriero

Hello,
I have a pedigree file such this:
FAMIDIDFA IDMO IDSEXSTATUS
110020
123122
143112
153110
163110
173122
183110
193110
1103120
1113110
130010
212131410
215121620
217121610
218121610
219121610
2200010
2210020
222121622
223121610
224121610
225121610
226121620
227282122
2290020
2140020
230312920
213312910
2310010
228203010
232282122
2160020
333343520
3350020
336343510
337343510
338343520
339343510
340343520
341343520
342343522
343343510
3340010
344343520
345343512
446474822
449474810
450474810
451474820
4470010
452474812
453474822
4480022
454474822
455474822
556575810
559606122
560626312
5620010
5630022
5570010
564575810
565606122
566575810
567686922
570686910
571686922
5680010
572575810
561575822
573575810
574575820
575606122
576575810
569575822
577575822
5780010
5580020
579787722
580787722
581787710
682838410
685838410
6860012
687868810
689868810
690868820
691868822
692879322
694868822
6840020
6950020
696838410
697838410
698838420
6990012
6100999520
69310110020
61010010
6102838420
688838422
6830010
6103838410
710410510610
710510710810
71070010
710910510622
711011111210
71120022
71130022
711411511612
711511711310
711811511612
711911511610
71170012
71080022
711611111222
712011111210
710611111222
71110010
712110510622
812212312420
812512312410
812612312410
812712312410
812812312412
812912312410
813012312410
813112312420
81230010
81240020
813212312422
913313413520
913613713310
913813713320
913713914010
914113914010
91420010
914313713322
914414514622
914514714810
914914514620
915014514620
915113713320
915213713310
915313713312
91480020
915413713310
915514115620
914615715520
91570010
915814514610
915914514610
91600010
916116016220
913516016220
91340010
91620020
91400020
91390010
91560020
914714216110
10163 

[R] Two-way Random Effects with unbalanced data

2012-10-29 Thread asafwe
Hi there,

I am looking to fit a two-way random effects model to an *unblalanced*
layout,

  y_ijk = mu + a_i + b_j + eps_ijk,
i=1,...,R, j=1,...,C, k=1,...,K_ij.

I am interested first of all in estimates for the variance components,
sigsq_a,  sigsq_b and sigsq_error.
In the balanced case, there are simple (MM, MLE) estimates for these; In the
unbalanced setup, this is much more complicated because orthogonality
relations no longer exist between "row space" and "column space". Since the
covariance structure between the cell means y_{ij.} is much more complicated
than in the one-way (unbalanced) case, trying to manually obtain MLEs looks
very difficult.
I couldn't find anything addressing point estimates for the unbalanced case
- neither in the literature nor in a computer program (R or alike). 

Any idea will be greatly appreciated...

Thank you,

Asaf



--
View this message in context: 
http://r.789695.n4.nabble.com/Two-way-Random-Effects-with-unbalanced-data-tp4647795.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] Interaction

2012-10-29 Thread Silvano Cesar da Costa
Hi,

I'm fitting a model with 3 variables: A, B and SNP.
The response variable is Y.

I would like fit the following model, in this order:

Y ~ A + B + A*B + SNP

In general, the R sets of the form:

Y ~ A + B + SNP + A*B

How do this?


-
Silvano Cesar da Costa

Universidade Estadual de Londrina
Centro de Ciências Exatas
Departamento de Estatística

Fone: (43) 3371-4346

__
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] Help with toupper()

2012-10-29 Thread scoyoc
Oh, sweet.
Thanks,
MVS



--
View this message in context: 
http://r.789695.n4.nabble.com/Help-with-toupper-tp4647781p4647783.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] I'm missing observations in plm()

2012-10-29 Thread Daniel Bab.
Hello,

I'm writing my Bachelor Thesis and I'm using the package plm for a
panelregression with fixed effects (individual and time).
My Dataset contains 11 variables (including the response) and has 486
observations of these.
In the observation I have missing values, which don't make a problem. If I
reduce my dataset from observations with missing values, it still contains
309 observations.
My Problem is, that my model by using plm only uses 286 of my observations.
23 observations are missing, which are distributed over 6 of my individuals
and don't contain missing values.
None of these observations should be identical to another in the dataset (I
only checked for one), so I can't figure out why I'm missing these
observations.



Example from my Dataset:
   TIME GEO Verkehrstote_Quote Autobahnlaenge_Quote PKW_Quote$Value
20 1991 Belgien188   0.05069903 398
21 1992 Belgien167   0.05094485 401
22 1993 Belgien165   0.05115993 408
23 1994 Belgien168   0.05119066 417
24 1995 Belgien143   0.05119066 422
25 1996 Belgien134   0.05143647 428
   LKW$Value Motorraeder$Value Bevoelkerungsquote Quote_Jung Quote_Alt
20  36.04695  14.91943   306.8666   13.79864  3.537448
21  36.61945  16.16444   307.9428   13.47332  3.595531
22  37.24554  17.38125   309.3661   13.21728  3.680058
23  38.71045  18.61270   310.3589   13.01022  3.738638
24  39.68186  19.74222   311.2790   12.82610  3.812795
25  41.11191  20.90102   311.6622   12.65081  3.808343
   Quote_Erstzulassungen BIP$Value Alkohol.Wert
200.01177985 1630011.49
210.12079010 1730011.74
220.09550608 1830011.72
230.09595748 1960011.23
240.08662883 2150011.10
250.09409657 2140011.07



Has anyone seen this problem before?
Thank you for dealing with my problem.

Regards,
Daniel



--
View this message in context: 
http://r.789695.n4.nabble.com/I-m-missing-observations-in-plm-tp4647791.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] GTK_2.18.5-X11.pkg

2012-10-29 Thread Cory Lowe
Does anyone know where I can download the GTK_2.18.5-X11.pkg? It has been 
removed from r.research.att.com/libs/ and I need it to use the RQDA package on 
my mac. Is there anyone who can direct me to someone who might have the file? 
Any help would be greatly appreciated.  
- Cory
__
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.


[R] Help with toupper()

2012-10-29 Thread scoyoc
Why in toupper() concatenating my column when I use it? I am trying to change
the case of a column in a dataframe to upper case...

> seedlings
  Plot Transect SppCode Count
1 M0722abco 9
2 M0721abco 7
3 M0721psme 1
4 M0723abco 9
> seedlings["SppCode"] = toupper(seedlings["SppCode"])

And I get...

> seedlings
  Plot Transect   SppCode Count
1 M0722 C("ABCO", "ABCO", "PSME", "ABCO") 9
2 M0721 C("ABCO", "ABCO", "PSME", "ABCO") 7
3 M0721 C("ABCO", "ABCO", "PSME", "ABCO") 1
4 M0723 C("ABCO", "ABCO", "PSME", "ABCO") 9

Not what I want. Suggestions?

Thanks,
MVS



--
View this message in context: 
http://r.789695.n4.nabble.com/Help-with-toupper-tp4647781.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] changing date by +/- days

2012-10-29 Thread chuck.01
Hi, 
Let say I have a date variable like this:

structure(1243792800, class = c("POSIXct", "POSIXt"), tzone = "GMT")
[1] "2009-05-31 18:00:00 GMT"

How can I make it 10 days prior, so:
[1] "2009-05-21 18:00:00 GMT"

I'm randomly selecting dates from a list  and want a  second value a set #
of days either before or after. 

Thanks ahead of time. 



--
View this message in context: 
http://r.789695.n4.nabble.com/changing-date-by-days-tp4647803.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] How emulate the function 'order' without with the function 'sort' in R

2012-10-29 Thread kamisama
Olá amigos tudo bem ? Espero que sim.

Sou novo aqui e gostaria muito da ajuda dos senhores para resolver um
pequeno probleminha no R.

Então, estou com um probleminha com uma atividade que relaciona duas funções
no R, é o seguinte:


Primeiro através da função sample é criado um vetor aleatótrio:

x <- sample(1:100, 20)

Depois aplico a função sort que tem como objetivo ordenar os elementos em
ordem crescente


sort(x)

Ai o problema aplica a função order em x:

order(x)

-

Ai o problema cita duas questões:


1) Qual é o objetivo da função order ?


2) Como emular, ou seja, como fazer que a função order realize o mesmo
objetivo que a função sort mas sem utilizar a função sort. E vice-versa ?




Para a questão 2 obtive a ajuda de um colega onde este me deu à dica de
fazer a primeira parte da questão da seguinte maneira:


Para fazer com que a função order execute o mesmo objetivo que a função
sort, faz-se o seguinte:


x[order(x)]


*Se plotarmos este comando no R realmente o objetivo da primeira pate da
questão é cumprido, porém não entendi o pq desses dois colchetes ?


** E como fazer com que a função sort realize o objetivo da função order mas
sem utilizar o order ??

Agradeço muito mesmo se puderem me ajudar na questão 1 e nas questões acima
(*) e (**)




--
View this message in context: 
http://r.789695.n4.nabble.com/How-emulate-the-function-order-without-with-the-function-sort-in-R-tp4647802.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Hausman test in R

2012-10-29 Thread fxen3k
Thanks for your answer, John!

Having read in Wooldridge, Verbeek and Hausman himself, I tried to figure
out how this whole Hausman test works.

I tried to figure out, if endogeneity exists in my particular case. So I did
this

Y ~ X + Z + Rest + error term [# this is the the original regression with Z
= instrumental variable for X, X = potentially endogenous variable and Rest
= more independent variables]
Regression 1:
X ~ Z + Rest + error term
Regression 2:
Y ~ X + Rest + residuals(Reg1) + error [# I took the residuals from
Regression 1 by Reg1_resid <- cbind(Red1$resid)

Finally, if the coefficient for the residuals is statistically significant,
there is endogeneity. 

Is this approach correct?

p.s: My p-value is 0.1138...

Thanks for your help





--
View this message in context: 
http://r.789695.n4.nabble.com/Hausman-test-in-R-tp4647716p4647800.html
Sent from the R help mailing list archive at Nabble.com.

__
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] changing date by +/- days

2012-10-29 Thread chuck.01
got it, sorry!

structure(1243792800, class = c("POSIXct", "POSIXt"), tzone =
"GMT")-(60*60*24*10)




chuck.01 wrote
> Hi, 
> Let say I have a date variable like this:
> 
> structure(1243792800, class = c("POSIXct", "POSIXt"), tzone = "GMT")
> [1] "2009-05-31 18:00:00 GMT"
> 
> How can I make it 10 days prior, so:
> [1] "2009-05-21 18:00:00 GMT"
> 
> I'm randomly selecting dates from a list  and want a  second value a set #
> of days either before or after. 
> 
> Thanks ahead of time.





--
View this message in context: 
http://r.789695.n4.nabble.com/changing-date-by-days-tp4647803p4647804.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] Hausman test error solve

2012-10-29 Thread gloria
Hello,
I am trying to conduct a Hausman test to choose between FE estimators and RE
estimators. 

When I try to run:

library(plm)

fixed <- plm(ROS ~ DiffClosenessC +ZZiele + AggSK + nRedundantStrecken +
Degree + KantenGew + BetweennessC + SitzKappazitaet, 
data=Panel,index=c("id","time"),model="within")   

summary(fixed)

fixef(fixed)

random <-plm(ROS ~ DiffClosenessC +ZZiele + AggSK + nRedundantStrecken +
Degree + KantenGew + BetweennessC + SitzKappazitaet, 
data=Panel,index=c("id","time"), model="random")   

summary(random)

phtest(fixed, random)

I get an error from phtest(fixed, random)

Fehler in solve.default(dvcov) : 
  System ist für den Rechner singulär: reziproke Konditionszahl = ...

Error in solve.default(dvcov) :
  system is computationally singular: reciprocal condition number =...

Can someone Help me with this problem or give me a hint where to look?

Thanks

gloria




--
View this message in context: 
http://r.789695.n4.nabble.com/Hausman-test-error-solve-tp4647793.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Which test should I use for comparing the change of two samples

2012-10-29 Thread chuck.01
1) get differences 
2) run t-test on #1

* Be warned: I am not a statistician.   


 

Tammy Ma wrote
> Dear All,
> 
> I have two samples as the following:
> conjps<-c(9.41,10.45,10.78,10.73,11.11,11.12,11.59,11.04,11.63)
> 
> ms<-c(4.11,5.10,5.70,6.46,6.04,6.16, 6.24,6.32,7.33)
> 
> I want to test the change of sample is same to the another one.
> conjps_ch<-c(1.04,0.33.)
> ms<-c(0.99,0.60,0.76)
> 
> 
> which test I should use, which conclusion can we drive based on the test?
> 
> I used the following test:
> 
> 
> •Test Equality
> of Two Variances
> 
>  F
> test to compare two variances
> 
> 
> 
> data: 
> conjps and ms 
> 
> F = 0.5419, num df = 8,
> denom df = 8,
> p-value = 0.4045
> 
> alternative hypothesis: true ratio of
> variances is not equal to 1 
> 
> 95 percent confidence interval:
> 
>  0.1222368 2.4024170 
> 
> sample estimates:
> 
> ratio of variances 
> 
> 
> 0.5419076 
> 
> 
> 
> is it correct? which conclusion can I get based on this?
> 
> 
> Thanks for help.
> 
> Kind regards,
> Tammy
> 
>   [[alternative HTML version deleted]]
> 
> 
> __

> R-help@

>  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.





--
View this message in context: 
http://r.789695.n4.nabble.com/Which-test-should-I-use-for-comparing-the-change-of-two-samples-tp4647756p4647798.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] why isn't integrate function working in a likelihood

2012-10-29 Thread stats12
Dear R users,

I have been trying to solve for mle's of a function that involves an
integral and I keep getting an error. I created an example to work on first
and even the simple example doesn't give me the mle's. I am getting the
error "Error in integrate(integrand, 0, Inf) : non-finite function value". 
I divided my likelihood function into two parts, one part involves integral
the other part doesn't. I don't see anything wrong in my code. Any hint
would be greatly appreciated. Thank you.

Z<-rbinom(20,1,0.5) #covariate

time<-rgamma(20,shape=2,scale=0.5) #failure time

del<-c(0,0,1,1,0,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1) #event indicator

ll<-function(p){

loglik1<-del*log(exp(Z*p[3])) #log of the first part of the likelihood
function

haz<-(time*exp(Z*p[3]))*p[1] 

ll2<-vector("numeric",length(1:20))
for (s in 1:20){
integrand<-function(x)
x^(del[s]+1/p[2]-1)*exp(-x/p[2])*exp(-x*haz[s])/(gamma(1+1/p[2])*p[2]^(1/p[2]))
ll2[s]<-log(integrate(integrand,0,Inf)$value)
}
loglik2<-as.vector(ll2) #second part of the likelihood function
lik<-sum(loglik1+loglik2)

-lik
}

initial<-c(1,1,1)
t<-nlm(ll,initial)

Error in integrate(integrand, 0, Inf) : non-finite function value


ll(c(1,1,1))
[1] 26.65748





--
View this message in context: 
http://r.789695.n4.nabble.com/why-isn-t-integrate-function-working-in-a-likelihood-tp4647787.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] model average for GLM comparison

2012-10-29 Thread tbcotten
I have several parameters that I measured to model with the presence of
frogs. (example. mod30<-glm(FROG~ maximum.depth, minimum.depth, Tree,
Shrub, data = regional_biotic, family=binomial) )I've calculated my AIC
table but can't for the life of me come up with code to model average for
models that are <2 AIC points from each other. I'm pretty new to both stats
and R, any help is appreciated.



--
View this message in context: 
http://r.789695.n4.nabble.com/model-average-for-GLM-comparison-tp4647796.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Gini with bias correction

2012-10-29 Thread David Winsemius

On Oct 26, 2012, at 9:32 AM, Diego Rojas wrote:

> Hey there,
> 
> I was wondering if someone could tell me if there's a package or command
> that allows me to compute a GINI coefficient using a vector of weights.
> Also the coefficient should be  bias corrected.

I do not think you have done your "homework". This is the blindingly obvious 
search strategy on Rseek:


http://www.rseek.org/?cx=010923144343702598753%3Aboaz1reyxd4&q=gini+coefficient+weighted&cof=FORID%3A11

You could also use the same search strategy with findFn in sos:

> require(sos)
> findFn("weighted gini coefficient")
found 13 matches;  retrieving 1 page

Downloaded 10 links in 7 packages.

After you have gone through that process,  the issues of bias correction may 
still be open, but you will need to explain what sort of bias correction you 
envisage. I know the rms/Hmisc package provide validation and optimism bias 
estimates based on a bootstrapping procedure, and that their author's position 
has been that using AUC or its equivalent the Gini coefficient as a model 
selection criterion is statistically less powerful than regression methods.



David Winsemius, MD
Alameda, CA, USA

__
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] How can I map numbers to colours with raster?

2012-10-29 Thread steven mosher
see the function level() in raster. also levelplot in rastervis package.
you basically create a raster attribute table coerce the raster to factor
class and plot. check geo sig i have posted the same question there
On Oct 29, 2012 2:15 AM, "Jonsson"  wrote:

> This code will read binary file and display it as a map. may problem is
> that
> this code is using a continuous colour scheme, even though I have discrete
> data (which  is a classification scheme). How can I map numbers to colours
> with raster? Please
>
> require(raster)
> conne <- file("C:\\lai.bin", "rb")
> sd<- readBin(conne, integer(), size=1,  n=360*720, signed=F)
>  y<-t(matrix((data=sd), ncol=360, nrow=720))
>  r = raster(y)
> extent(r) = extent(c(xmn=-180,xmx=180,ymn=-90,ymx=90))
> plot(r)
>
>
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/How-can-I-map-numbers-to-colours-with-raster-tp4647742.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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.
>

[[alternative HTML version deleted]]

__
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] Opening SAS file using read.sas7bdat() function in sas7bdat library.

2012-10-29 Thread Praveen Surendran
Dear all,

Thank you for the response and.. thanks Marc.
It works with the source file which Matt has at
https://github.com/BioStatMatt/sas7bdat/blob/master/R/sas7bdat.R
which is also attached.

Cheers,

Praveen.

-Original Message-
From: Marc Schwartz [mailto:marc_schwa...@me.com] 
Sent: 29 October 2012 19:14
To: Duncan Murdoch
Cc: Praveen Surendran; r-help@r-project.org
Subject: Re: [R] Opening SAS file using read.sas7bdat() function in sas7bdat
library.

On Oct 29, 2012, at 2:04 PM, Duncan Murdoch 
wrote:

> On 29/10/2012 2:54 PM, Marc Schwartz wrote:
>> On Oct 29, 2012, at 1:28 PM, Praveen Surendran 
wrote:
>> 
>> > Hi,
>> >
>> >
>> >
>> > I have a file in .sas7bdat format. I tried to open this file using
>> > read.sas7bdat() function.
>> >
>> > This gave me an error - "Error in read.sas7bdat("bnp_genetic.sas7bdat")
:
>> >
>> >  unknown host X64_7PRO".
>> >
>> > Could someone tell me what this error means?
>> >
>> > Thank you,
>> >
>> > Praveen.
>> 
>> 
>> More than likely, a similar problem as in this recent thread, but for 64
bit, rather than 32 bit:
>> 
>>   https://stat.ethz.ch/pipermail/r-help/2012-October/325257.html
> 
> If you look at the source for the function, it checks the "SAS_host"
against a known list, containing
> 
> # Host systems known to work
> KNOWNHOST <- c("WIN_PRO", "WIN_NT", "WIN_NTSV", "WIN_SRV",
>   "WIN_ASRV", "XP_PRO", "XP_HOME", "NET_ASRV",
>   "NET_DSRV", "NET_SRV", "WIN_98", "W32_VSPR",
>   "WIN", "WIN_95", "X64_VSPR", "X64_ESRV")
> 
> Praveen's host is not in that list, so the package author has never tested
it.   But nothing else in the code appears to depend on the host, so it's a
good guess that adding another host string to that list (or changing the
error to a warning) will make it work properly.
> 
> Duncan Murdoch


As per that prior thread, Matt has added those to the source on GitHub:

  https://github.com/BioStatMatt/sas7bdat/blob/master/R/sas7bdat.R

at line 86:

# Host systems known to work
KNOWNHOST <- c("WIN_PRO", "WIN_NT", "WIN_NTSV", "WIN_SRV",
   "WIN_ASRV", "XP_PRO", "XP_HOME", "NET_ASRV",
   "NET_DSRV", "NET_SRV", "WIN_98", "W32_VSPR",
   "WIN", "WIN_95", "X64_VSPR", "X64_ESRV",
   "W32_ESRV", "W32_7PRO", "W32_VSHO", "X64_7HOM",
   "X64_7PRO", "X64_SRV0")


It's presumably just a matter of Matt releasing an updated version of the
package. There were some comments in that prior thread of communication
issues with Matt, so not sure what is going on there relative to time frame.

Regards,

Marc

__
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] Opening SAS file using read.sas7bdat() function in sas7bdat library.

2012-10-29 Thread Marc Schwartz
On Oct 29, 2012, at 2:04 PM, Duncan Murdoch  wrote:

> On 29/10/2012 2:54 PM, Marc Schwartz wrote:
>> On Oct 29, 2012, at 1:28 PM, Praveen Surendran  
>> wrote:
>> 
>> > Hi,
>> >
>> >
>> >
>> > I have a file in .sas7bdat format. I tried to open this file using
>> > read.sas7bdat() function.
>> >
>> > This gave me an error - "Error in read.sas7bdat("bnp_genetic.sas7bdat") :
>> >
>> >  unknown host X64_7PRO".
>> >
>> > Could someone tell me what this error means?
>> >
>> > Thank you,
>> >
>> > Praveen.
>> 
>> 
>> More than likely, a similar problem as in this recent thread, but for 64 
>> bit, rather than 32 bit:
>> 
>>   https://stat.ethz.ch/pipermail/r-help/2012-October/325257.html
> 
> If you look at the source for the function, it checks the "SAS_host" against 
> a known list, containing
> 
> # Host systems known to work
> KNOWNHOST <- c("WIN_PRO", "WIN_NT", "WIN_NTSV", "WIN_SRV",
>   "WIN_ASRV", "XP_PRO", "XP_HOME", "NET_ASRV",
>   "NET_DSRV", "NET_SRV", "WIN_98", "W32_VSPR",
>   "WIN", "WIN_95", "X64_VSPR", "X64_ESRV")
> 
> Praveen's host is not in that list, so the package author has never tested 
> it.   But nothing else in the code appears to depend on the host, so it's a 
> good guess that adding another host string to that list (or changing the 
> error to a warning) will make it work properly.
> 
> Duncan Murdoch


As per that prior thread, Matt has added those to the source on GitHub:

  https://github.com/BioStatMatt/sas7bdat/blob/master/R/sas7bdat.R

at line 86:

# Host systems known to work
KNOWNHOST <- c("WIN_PRO", "WIN_NT", "WIN_NTSV", "WIN_SRV",
   "WIN_ASRV", "XP_PRO", "XP_HOME", "NET_ASRV",
   "NET_DSRV", "NET_SRV", "WIN_98", "W32_VSPR",
   "WIN", "WIN_95", "X64_VSPR", "X64_ESRV",
   "W32_ESRV", "W32_7PRO", "W32_VSHO", "X64_7HOM",
   "X64_7PRO", "X64_SRV0")


It's presumably just a matter of Matt releasing an updated version of the 
package. There were some comments in that prior thread of communication issues 
with Matt, so not sure what is going on there relative to time frame.

Regards,

Marc

__
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] Opening SAS file using read.sas7bdat() function in sas7bdat library.

2012-10-29 Thread Duncan Murdoch

On 29/10/2012 2:54 PM, Marc Schwartz wrote:

On Oct 29, 2012, at 1:28 PM, Praveen Surendran  wrote:

> Hi,
>
>
>
> I have a file in .sas7bdat format. I tried to open this file using
> read.sas7bdat() function.
>
> This gave me an error - "Error in read.sas7bdat("bnp_genetic.sas7bdat") :
>
>  unknown host X64_7PRO".
>
> Could someone tell me what this error means?
>
> Thank you,
>
> Praveen.


More than likely, a similar problem as in this recent thread, but for 64 bit, 
rather than 32 bit:

   https://stat.ethz.ch/pipermail/r-help/2012-October/325257.html


If you look at the source for the function, it checks the "SAS_host" 
against a known list, containing


# Host systems known to work
KNOWNHOST <- c("WIN_PRO", "WIN_NT", "WIN_NTSV", "WIN_SRV",
   "WIN_ASRV", "XP_PRO", "XP_HOME", "NET_ASRV",
   "NET_DSRV", "NET_SRV", "WIN_98", "W32_VSPR",
   "WIN", "WIN_95", "X64_VSPR", "X64_ESRV")

Praveen's host is not in that list, so the package author has never 
tested it.   But nothing else in the code appears to depend on the host, 
so it's a good guess that adding another host string to that list (or 
changing the error to a warning) will make it work properly.


Duncan Murdoch

__
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] Opening SAS file using read.sas7bdat() function in sas7bdat library.

2012-10-29 Thread Flavio Barros
I had the same error. I think this package is still experimental.

On Mon, Oct 29, 2012 at 4:28 PM, Praveen Surendran  wrote:

> Hi,
>
>
>
> I have a file in .sas7bdat format. I tried to open this file using
> read.sas7bdat() function.
>
> This gave me an error - "Error in read.sas7bdat("bnp_genetic.sas7bdat") :
>
>   unknown host X64_7PRO".
>
> Could someone tell me what this error means?
>
>
>
> Thank you,
>
>
>
> Praveen.
>
>
>
>
> [[alternative HTML version deleted]]
>
> __
> 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.
>



-- 
Att,

Flávio Barros

[[alternative HTML version deleted]]

__
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] Opening SAS file using read.sas7bdat() function in sas7bdat library.

2012-10-29 Thread Marc Schwartz
On Oct 29, 2012, at 1:28 PM, Praveen Surendran  wrote:

> Hi,
> 
> 
> 
> I have a file in .sas7bdat format. I tried to open this file using
> read.sas7bdat() function.
> 
> This gave me an error - "Error in read.sas7bdat("bnp_genetic.sas7bdat") : 
> 
>  unknown host X64_7PRO".
> 
> Could someone tell me what this error means?
> 
> Thank you,
> 
> Praveen.


More than likely, a similar problem as in this recent thread, but for 64 bit, 
rather than 32 bit:

  https://stat.ethz.ch/pipermail/r-help/2012-October/325257.html

Regards,

Marc Schwartz

__
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] Hausman test in R

2012-10-29 Thread John C Frain
On 29 October 2012 16:56, fxen3k  wrote:

snip

If we are talking about the same test a Hausman test can not be
applied to OLS regressions.  As you have already been told you must
have two estimates of the same set of coefficients to do a Hausman
test.

Suppose that you do OLS  and an IV estimates of a particular
regression you will get twu estimates of the coefficients in the
model. If the disturbances are not correlated with the explanatory
variables (no endogeneity) the two sets of coefficients will no be
similar.  If there is endogeneity the coefficients will be different.
The Hausman test is a test of the null that the coefficients are not
different.   If the null is accepted you will probably accept the OLS
regression. If the null is rejected you may consider the IV estimate.

A Hausman test is applicable in many other situations (fixed v random
effects etc.)  You may have problems with the estimate of the
covariance matrix used in the test as on occasion as, due to numerical
problems, the estimates of that matrix are not always positive
definite.

Most intermediate level econometrics textbooks will have a good
account of the Hausman test. Green(2012), Econometric Analysis 7th
edition, Prentice Hall. contains a comprehensive discussion of these
matters which you might read.  It is not easy but if you master the
basic concepts there, your questions about their implementation in R
are likely to be answered on this forum.

Best Regards

John

> I cannot imagine, no one in this forum has ever done a Hausman test on OLS
> regressions.
> I read in the systemfit package and found only this example referring to
> 2SLS and 3SLS regressions:
>
> data( "Kmenta" )
> eqDemand <- consump ~ price + income
> eqSupply <- consump ~ price + farmPrice + trend
> inst <- ~ income + farmPrice + trend
> system <- list( demand = eqDemand, supply = eqSupply )
> ## perform the estimations
> fit2sls <- systemfit( system, "2SLS", inst = inst, data = Kmenta )
> fit3sls <- systemfit( system, "3SLS", inst = inst, data = Kmenta )
> ## perform the Hausman test
> h <- hausman.systemfit( fit2sls, fit3sls )
> print( h )
>
>
>
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Hausman-test-in-R-tp4647716p4647774.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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.



-- 
John C Frain
Economics Department
Trinity College Dublin
Dublin 2
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:fra...@tcd.ie
mailto:fra...@gmail.com

__
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] Performing multiplication on duplicate values

2012-10-29 Thread arun
Hi Jorge,

I think this will be much more useful when you have triplicates or more.
dat1<-read.table(text="
Reference_Position Reference_Allele Variant_Allele Variant_Frequency   
AAC_Variant
   16    G  A 91.833811   
Val6Met,Met
   52    G  A 93.969466  
Val18Ile
   64    G  T 94.155381  
Val22Phe
   73    C  A 94.293478  
Gln25Lys
 131    G  A 94.268168  
Arg44Lys
 64  G  A 92.947658  
Ser48Asn
         72  G  A  85.9468   Gln25Phe   
 62  C  A  92.6583   
Arg42Lys 
 72  G  T  96.86688  
Ser48Lys
         72  G  C  94.8488   Arg42ln 
",sep="",header=TRUE,stringsAsFactors=FALSE) 
dat2<-dat1[,c(1,4)][duplicated(dat1$Reference_Position)|duplicated(dat1$Reference_Position,fromLast=TRUE),]
dat3<-do.call(rbind,lapply(split(dat2,dat2$Reference_Position),function(x) 
prod(x[,2])/100))
dat4<-data.frame(Reference_Position=row.names(dat3),Value=dat3)
 row.names(dat4)<-1:nrow(dat4)
 merge(dat1[,c(1,4)],dat4,by="Reference_Position",all=TRUE)
#   Reference_Position Variant_Frequency  Value
#1  16  91.83381 NA
#2  52  93.96947 NA
#3  62  92.65830 NA
#4  64  94.15538   87.51522
#5  64  92.94766   87.51522
#6  72  85.94680 7896.54044
#7  72  96.86688 7896.54044
#8  72  94.84880 7896.54044
#9  73  94.29348 NA
#10    131  94.26817 NA
 

A.K.



- Original Message -
From: Jorge Dinis 
To: arun 
Cc: 
Sent: Monday, October 29, 2012 1:17 PM
Subject: Re: [R] Performing multiplication on duplicate values

Thank you very much, I will give this a try!

JD
On Oct 29, 2012, at 12:15 PM, arun wrote:

> Hi,
> May be this helps:
> dat1<-read.table(text="
> Reference_Position Reference_Allele Variant_Allele Variant_Frequency   
> AAC_Variant
>                    16                G              A         91.833811   
>Val6Met,Met
>                    52                G              A         93.969466      
>Val18Ile
>                    64                G              T         94.155381      
>Val22Phe
>                    73                C              A         94.293478      
>Gln25Lys
>                  131                G              A         94.268168      
>Arg44Lys
>                  64                  G              A         92.947658      
>Ser48Asn
>          72                  G              A          85.9468       
>Gln25Phe  
>                  62                  C              A          92.6583       
>Arg42Lys 
>                  72                  G              T          96.86688      
>Ser48Lys
> ",sep="",header=TRUE,stringsAsFactors=FALSE) 
> dat2<-dat1[,c(1,4)][duplicated(dat1$Reference_Position)|duplicated(dat1$Reference_Position,fromLast=TRUE),]
> dat3<-do.call(rbind,lapply(split(dat2,dat2$Reference_Position),function(x) 
> (x[1,2]*x[2,2])/100))
> dat4<-data.frame(Reference_Position=row.names(dat3),Value=dat3)
>  row.names(dat4)<-1:nrow(dat4)
> merge(dat1[,c(1,4)],dat4,by="Reference_Position",all=TRUE)
> #  Reference_Position Variant_Frequency    Value
> #1                 16          91.83381       NA
> #2                 52          93.96947       NA
> #3                 62          92.65830       NA
> #4                 64          94.15538 87.51522
> #5                 64          92.94766 87.51522
> #6                 72          85.94680 83.25398
> #7                 72          96.86688 83.25398
> #8                 73          94.29348       NA
> #9                131          94.26817       NA
> 
> A.K.
> 
> 
> 
> 
> - Original Message -
> From: JDINIS 
> To: r-help@r-project.org
> Cc: 
> Sent: Monday, October 29, 2012 12:27 PM
> Subject: [R] Performing multiplication on duplicate values
> 
> Hello all,  thank you for your help. The task I need to perform is difficult
> to explain so I apologize a head of time for any confusion.
> 
> I have a data frame with these colnames() Reference_Position,
> Reference_Allele, Variant_Allele, Variant_Frequency,   AAC_Variant. If a
> value is duplicated in the "Reference_Position" column, I would both of
> their "Variant_Frequency" values multiplied and inserted into a new data
> frame.
> 
> example below: reference position 64 is repeated,  multiple 94.155381 by
> 92.947658 and insert value into "Value".
> 
> Because I do not know how to best explain this or phrase 

[R] Opening SAS file using read.sas7bdat() function in sas7bdat library.

2012-10-29 Thread Praveen Surendran
Hi,

 

I have a file in .sas7bdat format. I tried to open this file using
read.sas7bdat() function.

This gave me an error - "Error in read.sas7bdat("bnp_genetic.sas7bdat") : 

  unknown host X64_7PRO".

Could someone tell me what this error means?

 

Thank you,

 

Praveen.

 


[[alternative HTML version deleted]]

__
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] naming datasubsets in a loop

2012-10-29 Thread Rui Barradas

Hello,

The best way of doing what you want is to save the subsets in a list.

subsets.list <- vector("list", 10)
for(i in 1:10)
subsets.list[[i]] <- subset(...etc...)

names(subsets.list) <- names

You can also assign names using assign().


for(i in 1:10){
sb <- subset(...etc...)
assign(names[i], sb)
}


But this will create 10 different objects, the first way, using a list, 
keeps them all together.


Also, as you've seen, 'names' is an R function, choose something else 
for your variable name.


Hope this helps,

Rui Barradas
Em 29-10-2012 17:10, paladini escreveu:

Hello everbody,
I want to generate different subsets of my data-set and safe this 
subsets with names listet in a vector. Because in reality I have got 
about 70 subsets I want to realize this in a loop

Somehow like this:


names=c("nam1", 
"nam2","nam3","nam4","nam5","nam6","nam7","nam8","nam9","nam10")



for (i in 1:10){

subset(originaldata, originaldata[ ,130]<=time[i]) #This subset should 
get the name  safed in "names" on position i




}


I don't know how to realized it. None of my attempts worked,- so I 
would be grateful for help.


Best regards

Claudia

__
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.


__
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] export variable from bash to R

2012-10-29 Thread Barry Rowlingson
On Mon, Oct 29, 2012 at 10:43 AM, sophie  wrote:
> Dear R experts
>
> This probably seems very easy to you guys, but I'm a beginner and would be
> really glad if someone helped me with this:
> I am trying to automate the execution of an R script (let's call it
> "myscript.R") by passing a variable from a bash script to myscript.R.
> I know I can use the command Rscript, but I don't know how to declare in
> bash which variable will be accessed by the "commandArgs" command in
> myscript.R.
>
> So my bash script looks about like this:
>
> #!/bin/bash
>
> VARIABLES=( a b c d )
>
> for i in ${VARIABLES[@]}; do
> VARIABLENAME=$i
> Rscript -e 'source("myscript.R")'
> done
>
> In myscript.R, I would like to use the current VARIABLENAME when executing
> the program, i.e.,
> myscript <- function()  {
>
> args <- commandArgs(TRUE) # args should now be set to either a,b,c, or d
> load(paste("/home/user/../../", args, ".RData", sep=""))#  this defines
> the path to the data file that will be used in this run
>
> ...further commands...
> }
>
> At the moment, myscript.R doesn't seem to be executed at all when I execute
> the bash script.
> Any help will be greatly appreciated!

 Another replier has already suggested using commandArgs to get extra
arguments on the command line, but if you really want to push bash
variables through to R then you have to export them from bash and get
them using Sys.getenv in R:

$ export VARIABLENAME=a
$ R --slave
Sys.getenv("VARIABLENAME")
[1] "a"

(using R --slave to cut out all the startup messages etc)

Barry

__
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] Performing multiplication on duplicate values

2012-10-29 Thread arun
Hi,
May be this helps:
dat1<-read.table(text="
Reference_Position Reference_Allele Variant_Allele Variant_Frequency   
AAC_Variant
   16    G  A 91.833811   
Val6Met,Met
   52    G  A 93.969466  
Val18Ile
   64    G  T 94.155381  
Val22Phe
   73    C  A 94.293478  
Gln25Lys
 131    G  A 94.268168  
Arg44Lys
 64  G  A 92.947658  
Ser48Asn
         72  G  A  85.9468   Gln25Phe   
 62  C  A  92.6583   
Arg42Lys 
 72  G  T  96.86688  
Ser48Lys
",sep="",header=TRUE,stringsAsFactors=FALSE) 
dat2<-dat1[,c(1,4)][duplicated(dat1$Reference_Position)|duplicated(dat1$Reference_Position,fromLast=TRUE),]
dat3<-do.call(rbind,lapply(split(dat2,dat2$Reference_Position),function(x) 
(x[1,2]*x[2,2])/100))
dat4<-data.frame(Reference_Position=row.names(dat3),Value=dat3)
 row.names(dat4)<-1:nrow(dat4)
merge(dat1[,c(1,4)],dat4,by="Reference_Position",all=TRUE)
#  Reference_Position Variant_Frequency    Value
#1 16  91.83381   NA
#2 52  93.96947   NA
#3 62  92.65830   NA
#4 64  94.15538 87.51522
#5 64  92.94766 87.51522
#6 72  85.94680 83.25398
#7 72  96.86688 83.25398
#8 73  94.29348   NA
#9    131  94.26817   NA

A.K.




- Original Message -
From: JDINIS 
To: r-help@r-project.org
Cc: 
Sent: Monday, October 29, 2012 12:27 PM
Subject: [R] Performing multiplication on duplicate values

Hello all,  thank you for your help. The task I need to perform is difficult
to explain so I apologize a head of time for any confusion.

I have a data frame with these colnames() Reference_Position,
Reference_Allele, Variant_Allele, Variant_Frequency,   AAC_Variant. If a
value is duplicated in the "Reference_Position" column, I would both of
their "Variant_Frequency" values multiplied and inserted into a new data
frame.

example below: reference position 64 is repeated,  multiple 94.155381 by
92.947658 and insert value into "Value".

Because I do not know how to best explain this or phrase it into a logical
questions, here is a before and after. Also, if you could explain the code a
bit, that would be appreciated as well- teach and person to fish!


Before

>dat
[Reference_Position] [Reference_Allele] [Variant_Allele] [Variant_Frequency]  
[AAC_Variant]
                   16                G              A         91.833811  
Val6Met,Met
                   52                G              A         93.969466    
Val18Ile
                   64                G              T         94.155381    
Val22Phe
                   73                C              A         94.293478    
Gln25Lys
                 131                G              A         94.268168    
Arg44Lys
                 64                  G              A         92.947658    
Ser48Asn
After

>dat
[Reference_Position]    [Variant_Frequency]       [Value]
                   16                91.833811                            
NA
                   52                93.969466                            
NA
                   64                94.155381                        
85.152215
                   73                94.293478                           NA
                 131                94.268168                           NA
                   64                92.947658                        
85.152215




--
View this message in context: 
http://r.789695.n4.nabble.com/Performing-multiplication-on-duplicate-values-tp4647772.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


__
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.


[R] naming datasubsets in a loop

2012-10-29 Thread paladini

Hello everbody,
I want to generate different subsets of my data-set and safe this 
subsets with names listet in a vector. Because in reality I have got 
about 70 subsets I want to realize this in a loop

Somehow like this:


names=c("nam1", 
"nam2","nam3","nam4","nam5","nam6","nam7","nam8","nam9","nam10")



for (i in 1:10){

subset(originaldata, originaldata[ ,130]<=time[i]) #This subset should 
get the name  safed in "names" on position i




}


I don't know how to realized it. None of my attempts worked,- so I 
would be grateful for help.


Best regards

Claudia

__
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.


[R] naming datasubsets in a loop

2012-10-29 Thread paladini

Hello everbody,
I want to generate different subsets of my data-set and safe this 
subsets with names listet in a vector. Because in reality I have got 
about 70 subsets I want to realize this in a loop

Somehow like this:


names=c("nam1", 
"nam2","nam3","nam4","nam5","nam6","nam7","nam8","nam9","nam10")



for (i in 1:10){

subset(originaldata, originaldata[ ,130]<=time[i]) #This subset should 
get the name  safed in "names" on position i




}


I don't know how to realized it. None of my attempts worked,- so I 
would be grateful for help.


Best regards

Claudia

__
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] Hausman test in R

2012-10-29 Thread fxen3k
Given my "acknowledged statistical ignorance", I tried to find a *solution
*in this forum...
And this is not primarily a statistical issue, it is an issue about the
Hausman test in the R environment. 

I cannot imagine, no one in this forum has ever done a Hausman test on OLS
regressions.
I read in the systemfit package and found only this example referring to
2SLS and 3SLS regressions: 

data( "Kmenta" )
eqDemand <- consump ~ price + income
eqSupply <- consump ~ price + farmPrice + trend
inst <- ~ income + farmPrice + trend
system <- list( demand = eqDemand, supply = eqSupply )
## perform the estimations
fit2sls <- systemfit( system, "2SLS", inst = inst, data = Kmenta )
fit3sls <- systemfit( system, "3SLS", inst = inst, data = Kmenta )
## perform the Hausman test
h <- hausman.systemfit( fit2sls, fit3sls )
print( h )




--
View this message in context: 
http://r.789695.n4.nabble.com/Hausman-test-in-R-tp4647716p4647774.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] Performing multiplication on duplicate values

2012-10-29 Thread JDINIS
Hello all,  thank you for your help. The task I need to perform is difficult
to explain so I apologize a head of time for any confusion.

I have a data frame with these colnames() Reference_Position,
Reference_Allele, Variant_Allele, Variant_Frequency,   AAC_Variant. If a
value is duplicated in the "Reference_Position" column, I would both of
their "Variant_Frequency" values multiplied and inserted into a new data
frame.

example below: reference position 64 is repeated,  multiple 94.155381 by
92.947658 and insert value into "Value".

Because I do not know how to best explain this or phrase it into a logical
questions, here is a before and after. Also, if you could explain the code a
bit, that would be appreciated as well- teach and person to fish!


Before

 >dat
[Reference_Position] [Reference_Allele] [Variant_Allele] [Variant_Frequency]  
[AAC_Variant]
   16G  A 91.833811  
Val6Met,Met
   52G  A 93.969466 
Val18Ile
   64G  T 94.155381 
Val22Phe
   73C  A 94.293478 
Gln25Lys
 131G  A 94.268168 
Arg44Lys
 64  G  A 92.947658 
Ser48Asn
After

 >dat
[Reference_Position][Variant_Frequency]   [Value]
   1691.833811
NA
   5293.969466
NA
   6494.155381
85.152215
   7394.293478   NA
 13194.268168   NA
   6492.947658
85.152215




--
View this message in context: 
http://r.789695.n4.nabble.com/Performing-multiplication-on-duplicate-values-tp4647772.html
Sent from the R help mailing list archive at Nabble.com.

__
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] export variable from bash to R

2012-10-29 Thread Krzysztof Mitko
W dniu 29.10.2012 11:43, sophie pisze:
> Dear R experts
> 
> This probably seems very easy to you guys, but I'm a beginner and would be
> really glad if someone helped me with this:
> I am trying to automate the execution of an R script (let's call it
> "myscript.R") by passing a variable from a bash script to myscript.R. 
> I know I can use the command Rscript, but I don't know how to declare in
> bash which variable will be accessed by the "commandArgs" command in
> myscript.R.
> 
> So my bash script looks about like this:
> 
> #!/bin/bash
> 
> VARIABLES=( a b c d )
> 
> for i in ${VARIABLES[@]}; do
>   VARIABLENAME=$i
>   Rscript -e 'source("myscript.R")' 
> done

VARIABLES=(a b c d)
for i in ${VARIABLES[@]}
do
Rscript myscript.R $i
done

> In myscript.R, I would like to use the current VARIABLENAME when executing
> the program, i.e.,
> myscript <- function(){
> 
> args <- commandArgs(TRUE) # args should now be set to either a,b,c, or d
> load(paste("/home/user/../../", args, ".RData", sep=""))#  this defines
> the path to the data file that will be used in this run
>   
>  
> ...further commands...
> }
> 
> At the moment, myscript.R doesn't seem to be executed at all when I execute
> the bash script.

When loading the script with "source", the output won't show up unless
you explicitely print it (see ?source). Maybe it's executed but you just
don't see the output?

> Any help will be greatly appreciated!

-- 
Best regards,
Krzysztof Mitko

__
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] convert ff_vector object into as.Date

2012-10-29 Thread Jan
This might be what you are looking for. It uses with.ffdf from package
ffbase.

require(ffbase)
y_in_ffdf$dateval <- with(y_in_ffdf, as.Date(dateval) )

Jan



--
View this message in context: 
http://r.789695.n4.nabble.com/convert-ff-vector-object-into-as-Date-tp4647753p4647764.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Problems plotting a sparse time series in R

2012-10-29 Thread Alexander Engelhardt

Thanks to you two! :)

The zoo-manual explains the functions na.locf and na.approx, which deal 
with this problem. I have to admit I didn't read the whole thing before 
posting. But na.approx does exactly that - linear interpolation for all 
NA-points. Plots work fine after adding this line:


ts <- na.approx(ts)

Thanks again!
 -- Alex


On Oct 29, 2012, at 8:14 AM, Alexander Engelhardt wrote:


Hi guys,

I am logging data about my body (weight, body fat, blood pressure, ..)
in a .csv file and would like to plot this as a time series. I
uploaded the (noisified) .csv, you can see the link in the code I have
so far (you can run the code directly as-is):

   df.raw <-
read.csv("http://www.chaotic-neutral.de/temp/stats-noised.csv";,
sep=";", dec=".")
   date <- as.Date(df.raw[,1])
   comments <- df.raw[,2]
   stats <- df.raw[,-c(1,2)]

   
    timeSeries
   library(timeSeries)
   ts <- timeSeries(charvec=date, data=stats)
   plot(ts)

   
    zoo
   library(zoo)
   ts <- zoo(stats, date)
   plot(ts)


__
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.


[R] convert ff_vector object into as.Date

2012-10-29 Thread Bharat Warule
hello R Users!

Can anybody please help me how to convert ff_vector object into as.Date &
then I have apply  ffwhich condition?

class(y_in_ffdf$dateval)
[1] "ff_vector" "ff"   

y_in_ffdf$dateval <- as.Date(y_in_ffdf$dateval)
Error in as.Date.default(y_in_ffdf$dateval) : 
  do not know how to convert 'y_in_ffdf$dateval' to class "Date"
  
y_in_ffdf <- y_in_ffdf[ffwhich(y_in_ffdf$dateval >= max_span_start_date),]

Thanks,
BHarat



-
Bharat Warule 
Pune
--
View this message in context: 
http://r.789695.n4.nabble.com/convert-ff-vector-object-into-as-Date-tp4647753.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] conditional covariance matrix estimator

2012-10-29 Thread billycorg
Hi R Users,

following the work of Fleming, Kirby and Ostdiek (2001, you can find the
article  here

 
), I would like to estimate the conditional covariance matrax using an
exponentially weighted methods like:

 

where e_t is the Kx1 vector of returns at time t and the parameter /alpha
/has to be estimated. The /alpha /can be considered the decay rate the
maximizes the likelihood function:

 

Is there an R package that can be useful for me??

Thanks in advance for the help!!




--
View this message in context: 
http://r.789695.n4.nabble.com/conditional-covariance-matrix-estimator-tp4647751.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] Check Isomorphism between matrices

2012-10-29 Thread Haris Rhrlp
I have 3003 16x5 submatrices from a hadamard matrice of 16x15. I want to write 
an algorithm that check all of these 3003 matrices if they are isomorphic and i 
want to find and keep the non-isomorphic ones. Any help will be welcome. 
[[alternative HTML version deleted]]

__
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] for ( i in 23:0 ) { V <- vector [ 1 : i ] }

2012-10-29 Thread colaiutachambers
Thank you very much Rui.
I was in hurry because I'm working in a bank and on my master's degree
thesys at the same time.
I know Matlab, but they want I use R to price a convertible bond (I can't
get why...).
I read "An introduction to R" the last week-end and now I feel more
confortable.
This is an help section and was not looking for a good telling-off but I'm
sorry if I bothered somoone with my question.





--
View this message in context: 
http://r.789695.n4.nabble.com/for-i-in-23-0-V-vector-1-i-tp4647306p4647745.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] export variable from bash to R

2012-10-29 Thread sophie
Dear R experts

This probably seems very easy to you guys, but I'm a beginner and would be
really glad if someone helped me with this:
I am trying to automate the execution of an R script (let's call it
"myscript.R") by passing a variable from a bash script to myscript.R. 
I know I can use the command Rscript, but I don't know how to declare in
bash which variable will be accessed by the "commandArgs" command in
myscript.R.

So my bash script looks about like this:

#!/bin/bash

VARIABLES=( a b c d )

for i in ${VARIABLES[@]}; do
VARIABLENAME=$i
Rscript -e 'source("myscript.R")' 
done

In myscript.R, I would like to use the current VARIABLENAME when executing
the program, i.e.,
myscript <- function()  {

args <- commandArgs(TRUE) # args should now be set to either a,b,c, or d
load(paste("/home/user/../../", args, ".RData", sep=""))#  this defines
the path to the data file that will be used in this run

   
...further commands...
}

At the moment, myscript.R doesn't seem to be executed at all when I execute
the bash script.
Any help will be greatly appreciated!

Thanks,
sophie







--
View this message in context: 
http://r.789695.n4.nabble.com/export-variable-from-bash-to-R-tp4647749.html
Sent from the R help mailing list archive at Nabble.com.

__
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] PROBLEMS INSTALLING LIFEMETRICS

2012-10-29 Thread mary
I have Statconn. Lifemetrics is a software that is written in R. I have a
problem to install this add-ins in Excel. I don't know very good r language
and so I don't know where is the error to install it.



--
View this message in context: 
http://r.789695.n4.nabble.com/PROBLEMS-INSTALLING-LIFEMETRICS-tp4647717p4647748.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Why are coefficient estimates using ML and REML are different in lme?

2012-10-29 Thread Houhou Li
Thank you so much, S. Ellison.
 
Maybe I am wrong since I am still learning the mixed model, my impression is 
that variance and standard error estimates from REML and ML are 
different, coefficient estimates for fixed effects from both ML and REML are 
not necessarily identical, but should be similar. Is it normal to see such 
difference or did I obviously miss something? Thank you!   

--- On Mon, 10/29/12, S Ellison  wrote:


From: S Ellison 
Subject: RE: [R] Why are coefficient estimates using ML and REML are different 
in lme?
To: "Houhou Li" , "r-help@r-project.org" 

Date: Monday, October 29, 2012, 3:02 AM


Yi) Different criteria would be _exepcted_ to give different estimates.

ii) Look at teh standard errors on the coefficients. Essentially all of them 
are larger than the estimates for both fitting criteria.

Essentially, both models are telling you that your coefficients are not 
significantly different from zero.

S Ellison


From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf
Sent: 28 October 2012 23:55
To: r-help@r-project.org
Subject: [R] Why are coefficient estimates using ML and REML are different      
in lme?

Hi, All,

My data collection is from 4 regions (a, b, c, d). Within each region, it has 2 
or 3 units. Within each unit, it has measurement from about 25 sample site. I 
was trying to use lme function to discribe relationship between y and a few 
covariates. Both y and covariates were measured at the sample site level. My 
question is when I use exactlly the same model but choose different estimation 
method (ML vs REML), I got quite different coefficients esimate for fixed 
effect and variance estimate for random effect(see below). Can anyone here 
please help me to understand why? Thank you very much.


1) Using REML
lme(y~ Region*(x1+x2+x3), random=~1|unit, data=temp)

Linear mixed-effects model fit by REML
Data: temp
       AIC      BIC    logLik
  1498.871 1558.059 -731.4353
Random effects:
Formula: ~1 | unit
        (Intercept) Residual
StdDev:    5.837025 7.104742
Fixed effects: y ~ Region * (x1 + x2 + x3)
                                    Value Std.Error  DF   t-value p-value
(Intercept)                     162.28206 22.340090 193  7.264163  0.
Regionb                  -11.06624 24.582841   5 -0.450161  0.6714
Regionc                 5.01670 29.177730   5  0.171936  0.8702
Regiond                  -36.63434 26.262448   5 -1.394932  0.2218
x1                     0.04091  0.034732 193  1.177953  0.2403
x2                             -0.71649  0.356771 193 -2.008252  0.0460
x3                             -0.15945  0.375098 193 -0.425095  0.6712
Regionb:x1     -0.04451  0.046075 193 -0.965975  0.3353
.



2) using ML
lme(y~ Region*(x1+x2+x3), random=~1|unit, data=temp, method="ML")
Linear mixed-effects model fit by maximum likelihood
Data: temp
       AIC     BIC    logLik
  1478.793 1539.38 -721.3964
Random effects:
Formula: ~1 | unit
         (Intercept) Residual
StdDev: 0.0002763015 7.043271
Fixed effects: y ~ Region * (x1 + x2 + x3)
                                    Value Std.Error  DF   t-value p-value
(Intercept)                     155.05508 21.512500 193  7.207674  0.
Regionb                   10.56095 21.981366   5  0.480450  0.6512
Regionc                 9.88513 28.595621   5  0.345687  0.7436
Regiond                  -34.68996 24.177548   5 -1.434801  0.2108
x1                     0.05274  0.033903 193  1.555701  0.1214
x2                             -0.67642  0.365633 193 -1.849995  0.0658
x3                              0.09977  0.293438 193  0.340007  0.7342
Regionb:x1     -0.05692  0.046042 193 -1.236259  0.2179




        [[alternative HTML version deleted]]

***
This email and any attachments are confidential. Any use...{{dropped:11}}

__
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] Problems plotting a sparse time series in R

2012-10-29 Thread David Winsemius


On Oct 29, 2012, at 8:14 AM, Alexander Engelhardt wrote:


Hi guys,

I am logging data about my body (weight, body fat, blood  
pressure, ..) in a .csv file and would like to plot this as a time  
series. I uploaded the (noisified) .csv, you can see the link in the  
code I have so far (you can run the code directly as-is):


   df.raw <- read.csv("http://www.chaotic-neutral.de/temp/stats-noised.csv 
", sep=";", dec=".")

   date <- as.Date(df.raw[,1])
   comments <- df.raw[,2]
   stats <- df.raw[,-c(1,2)]

   
    timeSeries
   library(timeSeries)
   ts <- timeSeries(charvec=date, data=stats)
   plot(ts)

   
    zoo
   library(zoo)
   ts <- zoo(stats, date)
   plot(ts)


If you instead use this:

ts <- zoo(stats, date)
plot(ts, type="p")

You may get a better idea why your other panels in plot.zoo are emply.  
Y\In them you have no adjacent points that are not missing. R plotting  
routines generally break aa line plot at a missing value rather than  
drawing a line through missing data.


--

David.


I tried plotting the stuff with two packages, timeSeries and zoo.  
Both have the same problem: The column "Bauchfalte" which has a lot  
of entries (I measure this constantly), gets plotted, but the other  
ones don't. Most of them have only two entries and a lot of NAs, so  
I would at least expect a straight line between the two dates in  
those plots.


Maybe there is a problem with determining the ylim of the plots of  
the sparse columns, this is what an error message said. But I have  
no idea how to fix this.


Does anyone have an idea what's wrong here?

Also, if you have suggestions if there is a better format or way to  
log my data, I would appreciate that as well. I just figured the  
current way of one central date column and a lot of NAs for stuff I  
don't measure that day is the best way, because I'd like to add  
vertical lines at the dates with an entry in the "comment" column in  
every plot.


Thanks a lot!
- Alex

__
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.


David Winsemius, MD
Alameda, CA, USA

__
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] Problems plotting a sparse time series in R

2012-10-29 Thread Joshua Ulrich
On Mon, Oct 29, 2012 at 10:14 AM, Alexander Engelhardt
 wrote:
> Hi guys,
>
> I am logging data about my body (weight, body fat, blood pressure, ..) in a
> .csv file and would like to plot this as a time series. I uploaded the
> (noisified) .csv, you can see the link in the code I have so far (you can
> run the code directly as-is):
>
> df.raw <-
> read.csv("http://www.chaotic-neutral.de/temp/stats-noised.csv";, sep=";",
> dec=".")
> date <- as.Date(df.raw[,1])
> comments <- df.raw[,2]
> stats <- df.raw[,-c(1,2)]
>
> 
>  timeSeries
> library(timeSeries)
> ts <- timeSeries(charvec=date, data=stats)
> plot(ts)
>
> 
>  zoo
> library(zoo)
> ts <- zoo(stats, date)
> plot(ts)
>
Thanks for the reproducible example.

> I tried plotting the stuff with two packages, timeSeries and zoo. Both have
> the same problem: The column "Bauchfalte" which has a lot of entries (I
> measure this constantly), gets plotted, but the other ones don't. Most of
> them have only two entries and a lot of NAs, so I would at least expect a
> straight line between the two dates in those plots.
>
> Maybe there is a problem with determining the ylim of the plots of the
> sparse columns, this is what an error message said. But I have no idea how
> to fix this.
>
> Does anyone have an idea what's wrong here?
>
I'm not 100% certain, but I think plot.zoo only plots _consecutive_
observations as lines.

> Also, if you have suggestions if there is a better format or way to log my
> data, I would appreciate that as well. I just figured the current way of one
> central date column and a lot of NAs for stuff I don't measure that day is
> the best way, because I'd like to add vertical lines at the dates with an
> entry in the "comment" column in every plot.
>
I would plot the sparse data as points, not lines.  For example:
plot(ts, screens=1, type=c("l",rep("p",4)), col=rainbow(5))

> Thanks a lot!
>  - Alex
>
> __
> 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.

Best,
--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com

__
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.


[R] Java, rJava, and Windows x64

2012-10-29 Thread Robert Baer
When running [1] "R version 2.15.1 (2012-06-22)" "x86_64-pc-mingw32", 
rJava fails. I have installed both the 32-bit and 64-bit versions of 
Java 7 update 9.


> library(rJava)
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: stop("No CurrentVersion entry in '", key, "'! Try re-installing 
Java and make sure R and Java have matching architectures.")

error: object 'key' not found
Error: package/namespace load failed for ‘rJava’
>

It appears that rJava was not seeing the x64 Java. For clarity, I 
installed the 32-bit java library second, and I imagined this might be 
the problem. The Java installer told me that it was already present, and 
the x64 library appeared to be working with the 64-bit IE9 browser


Indeed, reinstalling Java x64, the rJava package iloaded fine with the 
library(rJava) command in 64-bit R. rJava could STILL be loaded with 
library(rJava) within x86 R.


My question is, should the order of Java installation affect the ability 
of rJava to load under 64-bit R? Are there environmental variables or 
registry settings that should be checked in such cases or is it 
literally necessary to do a complete reinstall?


Rob

__
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.


[R] Problems plotting a sparse time series in R

2012-10-29 Thread Alexander Engelhardt

Hi guys,

I am logging data about my body (weight, body fat, blood pressure, ..) 
in a .csv file and would like to plot this as a time series. I uploaded 
the (noisified) .csv, you can see the link in the code I have so far 
(you can run the code directly as-is):


df.raw <- 
read.csv("http://www.chaotic-neutral.de/temp/stats-noised.csv";, sep=";", 
dec=".")

date <- as.Date(df.raw[,1])
comments <- df.raw[,2]
stats <- df.raw[,-c(1,2)]


 timeSeries
library(timeSeries)
ts <- timeSeries(charvec=date, data=stats)
plot(ts)


 zoo
library(zoo)
ts <- zoo(stats, date)
plot(ts)

I tried plotting the stuff with two packages, timeSeries and zoo. Both 
have the same problem: The column "Bauchfalte" which has a lot of 
entries (I measure this constantly), gets plotted, but the other ones 
don't. Most of them have only two entries and a lot of NAs, so I would 
at least expect a straight line between the two dates in those plots.


Maybe there is a problem with determining the ylim of the plots of the 
sparse columns, this is what an error message said. But I have no idea 
how to fix this.


Does anyone have an idea what's wrong here?

Also, if you have suggestions if there is a better format or way to log 
my data, I would appreciate that as well. I just figured the current way 
of one central date column and a lot of NAs for stuff I don't measure 
that day is the best way, because I'd like to add vertical lines at the 
dates with an entry in the "comment" column in every plot.


Thanks a lot!
 - Alex

__
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] XML namespace control

2012-10-29 Thread Ben Tupper
Hi Duncan,

On Oct 29, 2012, at 9:24 AM, Duncan Temple Lang wrote:

> 
> Hi Ben
> 
>  Can you tell us the slightly bigger picture, please?
> Do you want to create a single similar node entirely in isolation
> or do you want to create it as part of an XML tree/document?
> Who will be reading the resulting XML.
> 
> You can use a parent node
> 
>  top = newXMLNode("storms", namespaceDefinitions = c(weather = 
> "http://my.weather.com/events";))
> 
> Then
> 
>newXMLNode("storm", "ripsnorter", namespace = "weather",
>attrs = c(type = "hurrican", name = "Sandy"),
>   parent = top )
> 
> 
> That gives you
> 
>   ripsnorter
> 
> So now what are you going to do with that node?
> 
> The namespace prefix is local to a document, chosen by the author of that XML 
> document.
> The namespace URI is the global key that authors and consumers must agree 
> upon.
> While your database may use "udf", you may chose a different prefix or even 
> the default
> prefix to correspond to that same URI.  So each document must explicitly 
> declare the
> prefix = URI mapping for it to be understood.
> 

Ah!   The parent - of course!  This makes perfect sense (and says so in the 
docs).   I think I was focussing on building up the hierarchy from the 
inside-to-the-outside.  That's obviously backwards (of course it's obvious now 
that I have gone public!)  

I must have I missed the boat when I read the documentation for the namespace 
argument to newXMLNode() ... 

"If this is a character vector with a) one element and b) with an empty names 
attribute and c) whose value does not start with http:/ or ftp:/, then it is 
assumed that the value is a namespace prefix for a namespace defined in an 
ancestor node. To be able to resolve this prefix to a namespace definition, 
parent must be specified so that we can traverse the chain of ancestor nodes. "

I wonder if that last sentence might be amended to read,  "To be able to 
resolve this prefix to a namespace definition, parent must be specified so that 
we can traverse the chain of ancestor nodes _to where the namespace is 
defined._"  I realize that this addition repeats the meaning of the previous 
sentence, but repetition never hurts boneheads like me. 

The bigger picture is that I am using this with a RESTful system which has been 
very kindly to this neophyte.  The parent tree, of which these user defined 
fields are children, will be POSTed to the system (using RCurl).

I have the parent just as you have shown 'top' above, but I had not included 
the namespace definitions that any of its children might need.  I have added 
the namespace definitions needed to the parent definition and all is well.

Thanks, once again, for making the XML package available.  It is incredibly 
useful.

Cheers,
Ben


>D.
> 
> 
> On 10/29/12 5:54 AM, Ben Tupper wrote:
>> Hello,
>> 
>> I am working with a database system from which I can retrieve these kinds of 
>> user defined fields formed as XML ...
>> 
>> 5
>> 
>> You can see in the above example that "field" is defined in the namespace 
>> "udf", but that the "udf" namespace is not defined along with the attributes 
>> of the node.  That is, 'xmlns:udf = "http://blah.blah.com/blah";' doesn't 
>> appear.  
>> 
>> I would like to create a similar node from scratch, but I can't seem to 
>> define the node with a namespace without providing the namespace definition. 
>> 
>> 
>> library(XML)
>> 
>> node1 <- newXMLNode("storm", "ripsnorter",
>>   namespace = "weather",
>>   namespaceDefinitions = c(weather = "http://my.weather.com/events";),
>>   attrs = c(type = "hurricane",  name = "Sandy"))
>> node1
>> 
>> # this returns the new node with the namespace prefix (which I want)
>> # and the definition (which I don't want)
>> 
>> # http://my.weather.com/events"; 
>> type="hurricane" name="Sandy">ripsnorter
>> 
>> 
>> node2 <- newXMLNode("storm", "ripsnorter",
>>   namespace = "weather",
>>   attrs = c(type = "hurricane",  name = "Sandy"),
>>   suppressNamespaceWarning = TRUE)
>> node2
>> 
>> # produces the node without the namespace prefix and without the definition
>> 
>> # ripsnorter
>> 
>> Is there some way to create a node with a namespace prefix but without 
>> embedding the namespace definition along with the attributes?
>> 
>> Thanks!
>> Ben
>> 
>> Ben Tupper
>> Bigelow Laboratory for Ocean Sciences
>> 180 McKown Point Rd. P.O. Box 475
>> West Boothbay Harbor, Maine   04575-0475 
>> http://www.bigelow.org
>> 
>> 
>>> sessionInfo()
>> R version 2.15.0 (2012-03-30)
>> Platform: i386-apple-darwin9.8.0/i386 (32-bit)
>> 
>> locale:
>> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>> 
>> attached base packages:
>> [1] stats graphics  grDevices utils datasets  methods   base 
>> 
>> other attached packages:
>> [1] tripack_1.3-4  RColorBrewer_1.0-5 Biostrings_2.24.1  IRanges_1.14.2  
>>BiocGenerics_0.2.0 RCurl_1.91-1  
>> [7] bitops_1.0-4.1 XML_3.9-4 
>> 
>> load

Re: [R] the right reference for the R Stats package for a scientific journal

2012-10-29 Thread Prof Brian Ripley

On 29/10/2012 14:08, gianni lavaredo wrote:

Dear Members list,

I am writing a paper for a research where i used "the R Stats package". No
one knows the right reference for this package?

Thanks in Advance
Gianni


Au contraire, anyone who reads the startup screen knows from:

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.




--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
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] the right reference for the R Stats package for a scientific journal

2012-10-29 Thread Ista Zahn
Hi Gianni,

At the R prompt run

citation("stats")

This will give you the citation info.

Best,
Ista
On Mon, Oct 29, 2012 at 10:08 AM, gianni lavaredo
 wrote:
> Dear Members list,
>
> I am writing a paper for a research where i used "the R Stats package". No
> one knows the right reference for this package?
>
> Thanks in Advance
> Gianni
>
> [[alternative HTML version deleted]]
>
> __
> 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.

__
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.


[R] the right reference for the R Stats package for a scientific journal

2012-10-29 Thread gianni lavaredo
Dear Members list,

I am writing a paper for a research where i used "the R Stats package". No
one knows the right reference for this package?

Thanks in Advance
Gianni

[[alternative HTML version deleted]]

__
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] Which test should I use for comparing the change of two samples

2012-10-29 Thread Bert Gunter
Is this homework? We don't do homework on this list.

You may also do better posting your question on
stats.stackexchange.com or other statistical list, as this appears to
be a statistics not an R question.

Cheers,

-- Bert

On Mon, Oct 29, 2012 at 6:12 AM, Tammy Ma  wrote:
>
> Dear All,
>
> I have two samples as the following:
> conjps<-c(9.41,10.45,10.78,10.73,11.11,11.12,11.59,11.04,11.63)
>
> ms<-c(4.11,5.10,5.70,6.46,6.04,6.16, 6.24,6.32,7.33)
>
> I want to test the change of sample is same to the another one.
> conjps_ch<-c(1.04,0.33.)
> ms<-c(0.99,0.60,0.76)
>
>
> which test I should use, which conclusion can we drive based on the test?
>
> I used the following test:
>
>
> •Test Equality
> of Two Variances
>
>  F
> test to compare two variances
>
>
>
> data:
> conjps and ms
>
> F = 0.5419, num df = 8,
> denom df = 8,
> p-value = 0.4045
>
> alternative hypothesis: true ratio of
> variances is not equal to 1
>
> 95 percent confidence interval:
>
>  0.1222368 2.4024170
>
> sample estimates:
>
> ratio of variances
>
>
> 0.5419076
>
>
>
> is it correct? which conclusion can I get based on this?
>
>
> Thanks for help.
>
> Kind regards,
> Tammy
>
> [[alternative HTML version deleted]]
>
>
> __
> 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.
>



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

__
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] XML namespace control

2012-10-29 Thread Duncan Temple Lang

Hi Ben

  Can you tell us the slightly bigger picture, please?
Do you want to create a single similar node entirely in isolation
or do you want to create it as part of an XML tree/document?
Who will be reading the resulting XML.

You can use a parent node

  top = newXMLNode("storms", namespaceDefinitions = c(weather = 
"http://my.weather.com/events";))

Then

newXMLNode("storm", "ripsnorter", namespace = "weather",
attrs = c(type = "hurrican", name = "Sandy"),
   parent = top )


That gives you

   ripsnorter

So now what are you going to do with that node?

The namespace prefix is local to a document, chosen by the author of that XML 
document.
The namespace URI is the global key that authors and consumers must agree upon.
While your database may use "udf", you may chose a different prefix or even the 
default
prefix to correspond to that same URI.  So each document must explicitly 
declare the
prefix = URI mapping for it to be understood.

D.


On 10/29/12 5:54 AM, Ben Tupper wrote:
> Hello,
> 
> I am working with a database system from which I can retrieve these kinds of 
> user defined fields formed as XML ...
> 
> 5
> 
> You can see in the above example that "field" is defined in the namespace 
> "udf", but that the "udf" namespace is not defined along with the attributes 
> of the node.  That is, 'xmlns:udf = "http://blah.blah.com/blah";' doesn't 
> appear.  
> 
> I would like to create a similar node from scratch, but I can't seem to 
> define the node with a namespace without providing the namespace definition. 
> 
> 
> library(XML)
> 
> node1 <- newXMLNode("storm", "ripsnorter",
>namespace = "weather",
>namespaceDefinitions = c(weather = "http://my.weather.com/events";),
>attrs = c(type = "hurricane",  name = "Sandy"))
> node1
> 
> # this returns the new node with the namespace prefix (which I want)
> # and the definition (which I don't want)
> 
> # http://my.weather.com/events"; 
> type="hurricane" name="Sandy">ripsnorter
> 
> 
> node2 <- newXMLNode("storm", "ripsnorter",
>namespace = "weather",
>attrs = c(type = "hurricane",  name = "Sandy"),
>suppressNamespaceWarning = TRUE)
> node2
> 
> # produces the node without the namespace prefix and without the definition
> 
> # ripsnorter
> 
> Is there some way to create a node with a namespace prefix but without 
> embedding the namespace definition along with the attributes?
> 
> Thanks!
> Ben
> 
> Ben Tupper
> Bigelow Laboratory for Ocean Sciences
> 180 McKown Point Rd. P.O. Box 475
> West Boothbay Harbor, Maine   04575-0475 
> http://www.bigelow.org
> 
> 
>> sessionInfo()
> R version 2.15.0 (2012-03-30)
> Platform: i386-apple-darwin9.8.0/i386 (32-bit)
> 
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
> 
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base 
> 
> other attached packages:
> [1] tripack_1.3-4  RColorBrewer_1.0-5 Biostrings_2.24.1  IRanges_1.14.2   
>   BiocGenerics_0.2.0 RCurl_1.91-1  
> [7] bitops_1.0-4.1 XML_3.9-4 
> 
> loaded via a namespace (and not attached):
> [1] stats4_2.15.0 tools_2.15.0
> 
> __
> 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.
> 
>

__
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] Hausman test in R

2012-10-29 Thread Millo Giovanni
Hello.
Well said Joshua. May I add that in an "OLS" context (which i take as
also meaning: no panel structure) what you probably want to do is the
so-called Durbin-Wu-Hausman test for endogeneity, as explained e.g.
here:

http://kurt.schmidheiny.name/teaching/iv2up.pdf

see Section 11 for the idea, and 13 for the R implementation.

Best wishes,
Giovanni

-- original message 
Date: Sun, 28 Oct 2012 16:03:43 -0700
From: Joshua Wiley 
To: fxen3k 
Cc: r-help@r-project.org
Subject: Re: [R] Hausman test in R
Message-ID:


Content-Type: text/plain

Hi,

I can think of no reason a Hausman test could not be used for OLS---it
is a
comparison of vectors of coefficients from different models usually
assumed
to produce similar estimates under certain conditions.  Dissimilarity is
taken as indicative of a lack of some or all the conditions required for
the two models to yield similar parameters.
I suggest you look at the plm and systemfit packages.  They have many
functions for OLS, 2SLS, tests of endogeneity, etc.  The plm (and maybe
systemfit?) package also has a vignette which is a good thing to read.
It
has a lot of useful information on the code and examples of comparing
different types of models, that you may find instructive.

Hope this helps,

Josh


On Sun, Oct 28, 2012 at 1:33 PM, fxen3k  wrote:

> Hi there,
>
> I am really new to statistics in R and statistics itself as well.
> My situation: I ran a lot of OLS regressions with different
independent
> variables. (using the lm() function).
> After having done that, I know there is endogeneity due to omitted
> variables. (or perhaps due to any other reasons).
> And here comes the Hausman test. I know this test is used to identify
> endogeneity.
> But what I am not sure about is: "Can I use the Hausman test in a
simple
> OLS
> regression or is it only possible in a 2SLS regression model?" "And if
it
> is
> possible to use it, how can I do it?"
>
> Info about the data:
>
> data = lots of data :)
>
> x1 <- data$x1
> x2 <- data$x2
> x3 <- data$x3
> x4 <- data$x4
> y1 <- data$y1
>
> reg1 <- summary(lm(y1 ~ x1 + x2 + x3 + x4))
>
> Thanks in advance for any support!
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Hausman-test-in-R-tp4647716.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/

--- end original message -

 
Ai sensi del D.Lgs. 196/2003 si precisa che le informazi...{{dropped:12}}

__
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.


[R] Which test should I use for comparing the change of two samples

2012-10-29 Thread Tammy Ma

Dear All,

I have two samples as the following:
conjps<-c(9.41,10.45,10.78,10.73,11.11,11.12,11.59,11.04,11.63)

ms<-c(4.11,5.10,5.70,6.46,6.04,6.16, 6.24,6.32,7.33)

I want to test the change of sample is same to the another one.
conjps_ch<-c(1.04,0.33.)
ms<-c(0.99,0.60,0.76)


which test I should use, which conclusion can we drive based on the test?

I used the following test:


•Test Equality
of Two Variances

 F
test to compare two variances



data: 
conjps and ms 

F = 0.5419, num df = 8,
denom df = 8,
p-value = 0.4045

alternative hypothesis: true ratio of
variances is not equal to 1 

95 percent confidence interval:

 0.1222368 2.4024170 

sample estimates:

ratio of variances 


0.5419076 



is it correct? which conclusion can I get based on this?


Thanks for help.

Kind regards,
Tammy
  
[[alternative HTML version deleted]]

__
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.


[R] (no subject)

2012-10-29 Thread Quincy A. Edwards


--
Quincy A. Edwards
http://www.quincyedwards.com

__
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.


[R] XML namespace control

2012-10-29 Thread Ben Tupper
Hello,

I am working with a database system from which I can retrieve these kinds of 
user defined fields formed as XML ...

5

You can see in the above example that "field" is defined in the namespace 
"udf", but that the "udf" namespace is not defined along with the attributes of 
the node.  That is, 'xmlns:udf = "http://blah.blah.com/blah";' doesn't appear.  

I would like to create a similar node from scratch, but I can't seem to define 
the node with a namespace without providing the namespace definition. 


library(XML)

node1 <- newXMLNode("storm", "ripsnorter",
   namespace = "weather",
   namespaceDefinitions = c(weather = "http://my.weather.com/events";),
   attrs = c(type = "hurricane",  name = "Sandy"))
node1

# this returns the new node with the namespace prefix (which I want)
# and the definition (which I don't want)

# http://my.weather.com/events"; type="hurricane" 
name="Sandy">ripsnorter


node2 <- newXMLNode("storm", "ripsnorter",
   namespace = "weather",
   attrs = c(type = "hurricane",  name = "Sandy"),
   suppressNamespaceWarning = TRUE)
node2

# produces the node without the namespace prefix and without the definition

# ripsnorter

Is there some way to create a node with a namespace prefix but without 
embedding the namespace definition along with the attributes?

Thanks!
Ben

Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd. P.O. Box 475
West Boothbay Harbor, Maine   04575-0475 
http://www.bigelow.org


> sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: i386-apple-darwin9.8.0/i386 (32-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base 

other attached packages:
[1] tripack_1.3-4  RColorBrewer_1.0-5 Biostrings_2.24.1  IRanges_1.14.2 
BiocGenerics_0.2.0 RCurl_1.91-1  
[7] bitops_1.0-4.1 XML_3.9-4 

loaded via a namespace (and not attached):
[1] stats4_2.15.0 tools_2.15.0

__
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] How can I map numbers to colours with raster?

2012-10-29 Thread Barry Rowlingson
On Mon, Oct 29, 2012 at 9:13 AM, Jonsson  wrote:
> This code will read binary file and display it as a map. may problem is that
> this code is using a continuous colour scheme, even though I have discrete
> data (which  is a classification scheme). How can I map numbers to colours
> with raster? Please
>
> require(raster)
> conne <- file("C:\\lai.bin", "rb")
> sd<- readBin(conne, integer(), size=1,  n=360*720, signed=F)
>  y<-t(matrix((data=sd), ncol=360, nrow=720))
>  r = raster(y)
> extent(r) = extent(c(xmn=-180,xmx=180,ymn=-90,ymx=90))
> plot(r)
>

 The raster package can handle categorical rasters, but it seems
poorly documented.

 If I read in a categorical raster (land cover classification from
CORINE) then I get a raster that plots using the colour table defined
in the GeoTIFF. This comes from a 'legend' attribute which the raster
object has. This is an undocumented object of class ".RasterLegend".

 I think Robert "Raster" Hijmans has been meaning to document all this
at some point, I've been meaning to dig into it too. Its probably
worth asking further questions on R-sig-geo.

Barry

__
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] Why are coefficient estimates using ML and REML are different in lme?

2012-10-29 Thread S Ellison
Yi) Different criteria would be _exepcted_ to give different estimates.

ii) Look at teh standard errors on the coefficients. Essentially all of them 
are larger than the estimates for both fitting criteria.

Essentially, both models are telling you that your coefficients are not 
significantly different from zero.

S Ellison


From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of 
Houhou Li [lidar...@yahoo.com]
Sent: 28 October 2012 23:55
To: r-help@r-project.org
Subject: [R] Why are coefficient estimates using ML and REML are different  
in lme?

Hi, All,

My data collection is from 4 regions (a, b, c, d). Within each region, it has 2 
or 3 units. Within each unit, it has measurement from about 25 sample site. I 
was trying to use lme function to discribe relationship between y and a few 
covariates. Both y and covariates were measured at the sample site level. My 
question is when I use exactlly the same model but choose different estimation 
method (ML vs REML), I got quite different coefficients esimate for fixed 
effect and variance estimate for random effect(see below). Can anyone here 
please help me to understand why? Thank you very much.


1) Using REML
lme(y~ Region*(x1+x2+x3), random=~1|unit, data=temp)

Linear mixed-effects model fit by REML
 Data: temp
   AIC  BIClogLik
  1498.871 1558.059 -731.4353
Random effects:
 Formula: ~1 | unit
(Intercept) Residual
StdDev:5.837025 7.104742
Fixed effects: y ~ Region * (x1 + x2 + x3)
Value Std.Error  DF   t-value p-value
(Intercept) 162.28206 22.340090 193  7.264163  0.
Regionb  -11.06624 24.582841   5 -0.450161  0.6714
Regionc 5.01670 29.177730   5  0.171936  0.8702
Regiond  -36.63434 26.262448   5 -1.394932  0.2218
x1 0.04091  0.034732 193  1.177953  0.2403
x2 -0.71649  0.356771 193 -2.008252  0.0460
x3 -0.15945  0.375098 193 -0.425095  0.6712
Regionb:x1 -0.04451  0.046075 193 -0.965975  0.3353
.



2) using ML
lme(y~ Region*(x1+x2+x3), random=~1|unit, data=temp, method="ML")
Linear mixed-effects model fit by maximum likelihood
 Data: temp
   AIC BIClogLik
  1478.793 1539.38 -721.3964
Random effects:
 Formula: ~1 | unit
 (Intercept) Residual
StdDev: 0.0002763015 7.043271
Fixed effects: y ~ Region * (x1 + x2 + x3)
Value Std.Error  DF   t-value p-value
(Intercept) 155.05508 21.512500 193  7.207674  0.
Regionb   10.56095 21.981366   5  0.480450  0.6512
Regionc 9.88513 28.595621   5  0.345687  0.7436
Regiond  -34.68996 24.177548   5 -1.434801  0.2108
x1 0.05274  0.033903 193  1.555701  0.1214
x2 -0.67642  0.365633 193 -1.849995  0.0658
x3  0.09977  0.293438 193  0.340007  0.7342
Regionb:x1 -0.05692  0.046042 193 -1.236259  0.2179




[[alternative HTML version deleted]]

***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
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] How can I map numbers to colours with raster?

2012-10-29 Thread Jonsson
Yes I did check but didn't know I modify the code accordingly.



--
View this message in context: 
http://r.789695.n4.nabble.com/How-can-I-map-numbers-to-colours-with-raster-tp4647742p4647744.html
Sent from the R help mailing list archive at Nabble.com.

__
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] How can I map numbers to colours with raster?

2012-10-29 Thread Pascal Oettli

Hello,

Did you check the arguments fo the function "plot", from the "raster" 
package? For example, the "col" argument.


Regards,
Pascal


Le 29/10/2012 18:13, Jonsson a écrit :

This code will read binary file and display it as a map. may problem is that
this code is using a continuous colour scheme, even though I have discrete
data (which  is a classification scheme). How can I map numbers to colours
with raster? Please

require(raster)
conne <- file("C:\\lai.bin", "rb")
sd<- readBin(conne, integer(), size=1,  n=360*720, signed=F)
  y<-t(matrix((data=sd), ncol=360, nrow=720))
  r = raster(y)
extent(r) = extent(c(xmn=-180,xmx=180,ymn=-90,ymx=90))
plot(r)





--
View this message in context: 
http://r.789695.n4.nabble.com/How-can-I-map-numbers-to-colours-with-raster-tp4647742.html
Sent from the R help mailing list archive at Nabble.com.

__
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.



__
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.


[R] How can I map numbers to colours with raster?

2012-10-29 Thread Jonsson
This code will read binary file and display it as a map. may problem is that
this code is using a continuous colour scheme, even though I have discrete
data (which  is a classification scheme). How can I map numbers to colours
with raster? Please

require(raster)
conne <- file("C:\\lai.bin", "rb")
sd<- readBin(conne, integer(), size=1,  n=360*720, signed=F)
 y<-t(matrix((data=sd), ncol=360, nrow=720))
 r = raster(y)
extent(r) = extent(c(xmn=-180,xmx=180,ymn=-90,ymx=90))
plot(r)

 



--
View this message in context: 
http://r.789695.n4.nabble.com/How-can-I-map-numbers-to-colours-with-raster-tp4647742.html
Sent from the R help mailing list archive at Nabble.com.

__
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] find the Best-ticker

2012-10-29 Thread sheen maria
Thank you


On Mon, Oct 29, 2012 at 1:44 PM, R. Michael Weylandt <
michael.weyla...@gmail.com>  wrote:

>
>
> On Oct 29, 2012, at 6:11 AM, sheenmaria  wrote:
>
> > i need to find the best ticker from the group of some tickers.?
> > i also need to know on what basis we calculate the best ticker?
> >  i have some idea about the if the risk rate low, or the market price
> > high we can say the ticker is best.
> >   but i dont know is it true.
> >
> >
> I've always been a big fan of the agribusiness ETF MOO!
>
> But seriously, I've answered this one from you before. The question is
> ill- posed without a metric but you may want to look at
> PerformanceAnalytics available via CRAN.
>
> Michael
>
>
> > Anyone can help me .
> >
> > Thank you
> >
> >
> >
> > --
> > View this message in context:
> http://r.789695.n4.nabble.com/find-the-Best-ticker-tp4647734.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > __
> > 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.
>

[[alternative HTML version deleted]]

__
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] Regarding the memory allocation problem

2012-10-29 Thread Milan Bouchet-Valat
Le lundi 29 octobre 2012 à 12:01 +0530, Purna chander a écrit :
> Dear Milan,
> 
> Thank you for telling about gc().
> 
> I'm using R 2.15.1. It's session info is displayed below:
> 
> R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
> Copyright (C) 2012 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
> Platform: i686-redhat-linux-gnu (32-bit)
> 
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
> 
>   Natural language support but running in an English locale
> 
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
> 
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
> 
> 
> ** I'm working with 3GB RAM. How can I use the available memory to
> optimize my goal.
Well, I gave you one idea, but for us to tell you more you need to give
us the code you are using. A better solution would be to spend some
money to buy more RAM, given it's quite cheap these days, and to install
a 64-bit version of Linux and R, if your computer supports it.


Regards


> On 10/26/12, Milan Bouchet-Valat  wrote:
> > Le jeudi 25 octobre 2012 à 15:02 +0530, Purna chander a écrit :
> >> Dear All,
> >>
> >>
> >> My main objective was to compute the distance of 10 vectors from a
> >> set having 900 other vectors. I've a file named "seq_vec" containing
> >> 10 records and 256 columns.
> >> While computing, the memory was not sufficient and resulted in error
> >> "cannot allocate vector of size 152.1Mb"
> >>
> >> So I've approached the problem in the following:
> >> Rather than reading the data completely at a time, I read the data in
> >> chunks of 2 records using scan() function. After reading each
> >> chunk, I've computed distance of each of these vectors with a set of
> >> another vectors.
> >>
> >> Even though I was successful in computing the distances for first 3
> >> chunks, I obtained similar error (cannot allocate vector of size
> >> 102.3Mb).
> >>
> >> Q) Here what I could not understand is, how come memory become
> >> insufficient when dealing with 4th chunk?
> >> Q) Suppose if i computed a matrix 'm' during calculation associated
> >> with chunk1, then is this matrix not replaced when I again compute 'm'
> >> when dealing with chunk 2?
> > R's memory management is relatively complex, i.e. objects are not always
> > replaced in memory, they are only garbage collected from time to time.
> > You may try to call gc() after each chunk to limit memory fragmentation,
> > which help reducing allocation problems a little.
> >
> > But please tell us how many RAM you have on the machine you're using,
> > and post the output of sessionInfo().
> >
> >
> > Regards
> >

__
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] find the Best-ticker

2012-10-29 Thread R. Michael Weylandt


On Oct 29, 2012, at 6:11 AM, sheenmaria  wrote:

> i need to find the best ticker from the group of some tickers.?
> i also need to know on what basis we calculate the best ticker?
>  i have some idea about the if the risk rate low, or the market price
> high we can say the ticker is best.
>   but i dont know is it true.
> 
> 
I've always been a big fan of the agribusiness ETF MOO!

But seriously, I've answered this one from you before. The question is ill- 
posed without a metric but you may want to look at PerformanceAnalytics 
available via CRAN. 

Michael


> Anyone can help me .
> 
> Thank you
> 
> 
> 
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/find-the-Best-ticker-tp4647734.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> __
> 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.

__
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] find the Best-ticker

2012-10-29 Thread Jeff Newmiller
This is not a question about R, but rather about quantitative financial 
analysis theory that could be applied using any of many different computational 
tools. As such this question is off-topic here.
---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

sheenmaria  wrote:

>i need to find the best ticker from the group of some tickers.?
>i also need to know on what basis we calculate the best ticker?
>   i have some idea about the if the risk rate low, or the market price
>high we can say the ticker is best.
>   but i dont know is it true.
>
>
>Anyone can help me .
>
>Thank you
>
>
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/find-the-Best-ticker-tp4647734.html
>Sent from the R help mailing list archive at Nabble.com.
>
>__
>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.

__
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] MANCOVA

2012-10-29 Thread Pascal Oettli

Hi !

Why don't you use web search engine?

Regards,
Pascal


Le 29/10/12 16:03, paola a écrit :

Hi everybidy

Does anybody knows the code in R relate to MANCOVA???I saw somewhere
lm(Y`...) but  ma not so sure..

Thanks in advance!!
Paola



--
View this message in context: 
http://r.789695.n4.nabble.com/MANCOVA-tp4647735.html
Sent from the R help mailing list archive at Nabble.com.

__
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.



__
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.