Dear,
        I am having problem importing data from other packages or spreadsheet to R. The data file contains characters and numerics variables.

r-help-request@r-project.org wrote:
  Send R-help mailing list submissions to
r-help@r-project.org

To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-help
or, via email, send a message with subject or body 'help' to
r-help-request@r-project.org

You can reach the person managing the list at
r-help-owner@r-project.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-help digest..."


Today's Topics:

1. Help in error of mixed models (Bernardo Rangel Tura)
2. Where to ask general stats questions? (francogrex)
3. Re: structure vs. matrix (Mark Difford)
4. Problems with garch() function tseries package R 2.6.0
(Jos? Augusto Morais de Andrade J?nior - JAMAJ)
5. Re: Where to ask general stats questions? (Patrick Drechsler)
6. help on error message!!! (david csongor)
7. Re: structure vs. matrix (Duncan Murdoch)
8. Re: structure vs. matrix (Duncan Murdoch)
9. Re: help on error message!!! (Duncan Murdoch)
10. Re: help on error message!!! (Bernardo Rangel Tura)
11. Re: Problems with garch() function tseries package R 2.6.0
(Prof Brian Ripley)
12. Re: structure vs. matrix (Prof Brian Ripley)
13. Why can repeated measures anova with within & between
subjects design not be done if group sizes are unbalanced? (Gilbert G)
14. Re: markov regime switching models (Liviu Andronic)
15. Re: Why can repeated measures anova with within & between
subjects design not be done if group sizes are unbalanced?
(Charles C. Berry)
16. Problem implementing adapt() (Sergey Goriatchev)
17. Problem implementing adapt() (Sergey Goriatchev)
18. Re: [Spam] Re: Problems with garch() function tseries package
R 2.6.0 (Jos? Augusto Morais de Andrade J?nior - JAMAJ)
19. Re: Problems with garch() function tseries package R 2.6.0
(Jos? Augusto Morais de Andrade J?nior - JAMAJ)
20. install problem 2.6 mac os x 10.5 (Oscar Moreno)
21. Re: R CMD SHLIB gives error: bad value (generic) for -mtune=
switch (McKay Curtis)
22. hierarchical mixed model (Irene Mantzouni)
23. Re: Problems with garch() function tseries package R 2.6.0
(Jos? Augusto Morais de Andrade J?nior - JAMAJ)
24. Re: Problems with garch() function tseries package R 2.6.0
(Jos? Augusto Morais de Andrade J?nior - JAMAJ)
25. Re: unable to install package ff (Matthew Keller)
26. Re: install problem 2.6 mac os x 10.5 (Matthew Keller)
27. Re: Help in error of mixed models (Andrew Robinson)
28. Re: install problem 2.6 mac os x 10.5 (Chung-hong Chan)
29. R package "segmented" (Maura E Monville)
30. Re: structure vs. matrix (Edna Bell)
31. Sending E-Mail from R (Josh Kalish)
32. Re: structure vs. matrix (Gabor Grothendieck)
33. Re: Sending E-Mail from R (Gabor Grothendieck)
34. Re: Sending E-Mail from R ( (Ted Harding))
35. Re: perl module for R (Lux Zhang)
36. Re: Sending E-Mail from R (Benilton Carvalho)
37. multidensional integration with adapt (Helene)
38. multidimensional integration with adapt (Helene)
39. R2HTML package and Open Office: text only pasted (Graham Smith)
40. How to reconstitute a Product-Outcome table? (francogrex)
41. Fw: Creating a barplot--advice needed (Thomas L Jones, PhD)
42. Help about exception handling in r-project. (ANUSHA AIYALU KANNAN)
43. Garch() function of tseries package doesnt work anymore
(Jos? Augusto Morais de Andrade J?nior - JAMAJ)
44. SuSE 10.3 R GUI up&running (Maura E Monville)
45. Installing R on Mac OS X Leopard (Mitch Ohriner)
46. Re: Installing R on Mac OS X Leopard (Chung-hong Chan)
47. Re: cumsum (ONKELINX, Thierry)
48. Re: How to reconstitute a Product-Outcome table?
(Gabor Grothendieck)
49. Re: Trellis dotplot label keys (Patrick Connolly)
50. Odp: Fw: Creating a barplot--advice needed (Petr PIKAL)
51. do.call without arguments? (Antje)
52. Re: do.call without arguments? (Peter Dalgaard)
53. Re: do.call without arguments? (Antje)


----------------------------------------------------------------------

Message: 1
Date: Sun, 04 Nov 2007 09:18:09 -0200
From: Bernardo Rangel Tura 
Subject: [R] Help in error of mixed models
To: r-help 
Message-ID: <1194175090.5917.11.camel@R3-Thux>
Content-Type: text/plain; charset="us-ascii"


Hi R-masters

I read the article: Bivariate analysis of sensitivity and specificity
produces informative summary measures in diagnostic reviews.

In this paper i proposed a bivariate mixed model and use SAS proc mixed
to adjust the estimates.


I thinks use R to make the same and try with this code:

base<-read.csv("base.csv")
adj<-.5
attach(base)

sens<-(VP+adj)/(VP+FN+2*adj)
log.S<-log(sens/(1-sens))
var.log.S<-1/(sens*(1-sens)*(VP+FN))
dis<-rep(1,length(log.S))
non.dis<-rep(0,length(log.S))
data.S<-data.frame(id,Modality,log.S,var.log.S,dis,non.dis)
names(data.S)<-c("id","Modality","logit","var.logit","dis","non.dis")

esp<-(VN+adj)/(VN+FP+2*adj)
log.E<-log((1-esp)/esp)
var.log.E<-1/(esp*(1-esp)*(VN+FP))
dis<-rep(0,length(log.E))
non.dis<-rep(1,length(log.E))
data.E<-data.frame(id,Modality,log.E,var.log.E,dis,non.dis)
names(data.E)<-c("id","Modality","logit","var.logit","dis","non.dis")

data.bi<-rbind(data.S,data.E)
require(nlme) 
lme(logit~dis*Modality+non.dis*Modality, random=~dis|id+non.dis|
id,data=data.bi)

but i recive a erro msg :

Error in MEEM(object, conLin, control$niterEM) : 
Singularity in backsolve at level 0, block 1


How in solve this problem? Whats is wrong?

Thanks in advance
-- 
Bernardo Rangel Tura, M.D,Ph.D
National Institute of Cardiology
Brazil

------------------------------

Message: 2
Date: Sun, 4 Nov 2007 03:55:38 -0800 (PST)
From: francogrex 
Subject: [R] Where to ask general stats questions?
To: r-help@r-project.org
Message-ID: <13571915.post@talk.nabble.com>
Content-Type: text/plain; charset=us-ascii


I see that some people ask general statistics questions here sometimes. As I
understand this list is only for "technical" help with R-related issues. But
does anyone know of a list/forum where we can ask help/questions regarding
general statistics problems (and where solutions are offered possibly in the
R language) . I know that usenet has some forums/groups but though those
groups offer good solutions they are not necessarily in the context of the
R/S langauge, in fact they are mostly either general hints without computer
solution or if so then they mostly offer non-R codes.
Thanks.
-- 
View this message in context: http://www.nabble.com/Where-to-ask-general-stats-questions--tf4746189.html#a13571915
Sent from the R help mailing list archive at Nabble.com.



------------------------------

Message: 3
Date: Sun, 4 Nov 2007 04:43:44 -0800 (PST)
From: Mark Difford 
Subject: Re: [R] structure vs. matrix
To: r-help@r-project.org
Message-ID: <13572508.post@talk.nabble.com>
Content-Type: text/plain; charset=us-ascii


Hi Edna,

>> When creating a matrix, is it better to use the structure function or the
>> matrix function...?

I hope you have a huge (empty) jar in the kitchen, and that your pantry is
empty.

R isn't too difficult, except if you're trying to do stats (and don't know
what you are doing --- though I am not suggesting that you don't know how to
do stats;).

## see
?structure
?matrix

A structure is not a matrix. So, if you want to make a matrix, use
matrix(). Easy.

HTH,
Mark.


Edna Bell wrote:
> 
> Hi R Gurus!
> 
> When creating a matrix, is it better to use the structure function or
> the matrix function, please?
> 
> Thanks,
> Edna Bell
> 
> ______________________________________________
> 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/structure-vs.-matrix-tf4745521.html#a13572508
Sent from the R help mailing list archive at Nabble.com.



------------------------------

Message: 4
Date: Sun, 4 Nov 2007 11:45:20 -0200
From: Jos? Augusto Morais de Andrade J?nior - JAMAJ

Subject: [R] Problems with garch() function tseries package R 2.6.0
To: r-help@r-project.org
Message-ID: 
Content-Type: text/plain; charset=iso-8859-1

Hi all,

I recently updated my to R 2.6.0 and tseries package ?tseries? version: 0.10-11.

When i was using R Version 2.3.1 (2006-06-01) with tseries 'tseries' version: 0.10-7, the code 
> garch(dflnRCLC1)
***** ESTIMATION WITH ANALYTICAL GRADIENT ***** 

Call:
garch(x = dflnRCLC1)
Coefficient(s):
a0 a1 b1 
4.985e+00 1.880e-01 6.210e-14 
> 
worked very quick and well.

Now, with the newer version of R and tseries, this code hangs and doesnt give any result

> garch(dflnRCLC1)
***** ESTIMATION WITH ANALYTICAL GRADIENT ***** 
its hangs forever...


What happens?

Regards,

Jos? Augusto Jr.
University of S?o Paulo



------------------------------

Message: 5
Date: Sun, 04 Nov 2007 15:02:13 +0100
From: Patrick Drechsler 

Subject: Re: [R] Where to ask general stats questions?
To: r-help@stat.math.ethz.ch
Message-ID: <87mytu9kii.fsf@pdrechsler.de>
Content-Type: text/plain; charset=us-ascii

francogrex writes:

> But does anyone know of a list/forum where we can ask help/questions
> regarding general statistics problems (and where solutions are
> offered possibly in the R language) .

You could try the newsgroup sci.stat.math or sci.stat.consult.

HTH

Patrick
-- 
We are sorry, but the number you have dialed is imaginary.
Please rotate your phone 90 degrees and try again.



------------------------------

Message: 6
Date: Sun, 4 Nov 2007 15:06:20 +0100
From: "david csongor" 
[[replacing trailing spam]]
To: r-help@stat.math.ethz.ch
Message-ID:
<181cfc180711040606l26bc01bag2275b6c91c8bde5e@mail.gmail.com>
Content-Type: text/plain

[[replacing trailing spam]]
I am looping some simple stuff but when I enter an if - function I get this
error message:

>>>>
Error in if (y < (2/(1 * pi) * sqrt(1 - ((x - 2)/1)^2))) c[i] = x else c[i]
= 0 :
missing value where TRUE/FALSE needed
>>>>

WHAT does it mean, what should I do????

[[alternative HTML version deleted]]



------------------------------

Message: 7
Date: Sun, 04 Nov 2007 09:18:13 -0500
From: Duncan Murdoch 
Subject: Re: [R] structure vs. matrix
To: Edna Bell 
Cc: r-help@stat.math.ethz.ch
Message-ID: <472DD4A5.1020409@stats.uwo.ca>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 04/11/2007 1:28 AM, Edna Bell wrote:
> Hi R Gurus!
> 
> When creating a matrix, is it better to use the structure function or
> the matrix function, please?

I'd use the matrix() function. You can do it with structure(), and your 
code might be a little faster, but it will be harder to read, will break 
if someone ever changes the low-level implementation of matrices, e.g. 
by replacing it with the Matrix class.

Duncan Murdoch



------------------------------

Message: 8
Date: Sun, 04 Nov 2007 09:19:38 -0500
From: Duncan Murdoch 
Subject: Re: [R] structure vs. matrix
To: Mark Difford 
Cc: r-help@r-project.org
Message-ID: <472DD4FA.5050809@stats.uwo.ca>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 04/11/2007 7:43 AM, Mark Difford wrote:
> Hi Edna,
> 
>>> When creating a matrix, is it better to use the structure function or the
>>> matrix function...?
> 
> I hope you have a huge (empty) jar in the kitchen, and that your pantry is
> empty.
> 
> R isn't too difficult, except if you're trying to do stats (and don't know
> what you are doing --- though I am not suggesting that you don't know how to
> do stats;).
> 
> ## see
> ?structure
> ?matrix
> 
> A structure is not a matrix. So, if you want to make a matrix, use
> matrix(). Easy.

But a matrix is a structure, so you could use structure() to create one. 
I wouldn't normally do that, but there might be circumstances where it 
was appropriate.

Duncan Murdoch

> 
> HTH,
> Mark.
> 
> 
> Edna Bell wrote:
>> Hi R Gurus!
>>
>> When creating a matrix, is it better to use the structure function or
>> the matrix function, please?
>>
>> Thanks,
>> Edna Bell
>>
>> ______________________________________________
>> 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.
>>
>>
>



------------------------------

Message: 9
Date: Sun, 04 Nov 2007 09:22:40 -0500
From: Duncan Murdoch 
[[replacing trailing spam]]
To: david csongor 
Cc: r-help@stat.math.ethz.ch
Message-ID: <472DD5B0.4040202@stats.uwo.ca>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 04/11/2007 9:06 AM, david csongor wrote:
[[replacing trailing spam]]
> I am looping some simple stuff but when I enter an if - function I get this
> error message:
> 
> Error in if (y < (2/(1 * pi) * sqrt(1 - ((x - 2)/1)^2))) c[i] = x else c[i]
> = 0 :
> missing value where TRUE/FALSE needed
> 
> WHAT does it mean, what should I do????

if ( condition ) requires that the condition evaluate to something that 
it can interpret as TRUE or FALSE. Your condition was

y < (2/(1 * pi) * sqrt(1 - ((x - 2)/1)^2))

and it evaluated to a missing value. Several reasons this could happen: 
y was missing, x was missing, you tried to take a square root of a 
negative number, etc.

Duncan Murdoch



------------------------------

Message: 10
Date: Sun, 04 Nov 2007 12:27:05 -0200
From: Bernardo Rangel Tura 
[[replacing trailing spam]]
To: david csongor 
Cc: r-help@stat.math.ethz.ch
Message-ID: <1194186425.5917.23.camel@R3-Thux>
Content-Type: text/plain


On Sun, 2007-11-04 at 15:06 +0100, david csongor wrote:
[[replacing trailing spam]]
> I am looping some simple stuff but when I enter an if - function I get this
> error message:
> 
> >>>>
> Error in if (y < (2/(1 * pi) * sqrt(1 - ((x - 2)/1)^2))) c[i] = x else c[i]
> = 0 :
> missing value where TRUE/FALSE needed
> >>>>
> 
> WHAT does it mean, what should I do????

Try ifelse:

c<-ifelse(y < (2/(1 * pi)*sqrt(1 -(x - 2)^2)),x,c[i])
-- 
Bernardo Rangel Tura, M.D,Ph.D
National Institute of Cardiology
Brazil



------------------------------

Message: 11
Date: Sun, 4 Nov 2007 15:07:50 +0000 (GMT)
From: Prof Brian Ripley 
Subject: Re: [R] Problems with garch() function tseries package R
2.6.0
To: Jos? Augusto Morais de Andrade J?nior - JAMAJ 
Cc: r-help@R-project.org, Kurt Hornik 
Message-ID: 

Content-Type: text/plain; charset="iso-8859-1"

Hmm, did you forget to tell us the minimal information required by the 
posting guide? And what did the package maintainer say?

A guess: you are using Windows and doing this in Rgui. I believe 
'tseries' does Fortran I/O, and this is a symptom we have seen before.
The workaround is to use Rterm, not Rgui.

Some (maybe all) packages that attempt to do Fortran output in Rgui 2.6.0 
will loop indefinitely waiting for stdout which does not exist on a 
console.


On Sun, 4 Nov 2007, Jos? Augusto Morais de Andrade J?nior - JAMAJ wrote:

> Hi all,
>
> I recently updated my to R 2.6.0 and tseries package ?tseries? version: 
> 0.10-11.
>
> When i was using R Version 2.3.1 (2006-06-01) with tseries 'tseries' 
> version: 0.10-7, the code
>> garch(dflnRCLC1)
> ***** ESTIMATION WITH ANALYTICAL GRADIENT *****
>
> Call:
> garch(x = dflnRCLC1)
> Coefficient(s):
> a0 a1 b1
> 4.985e+00 1.880e-01 6.210e-14
>>
> worked very quick and well.
>
> Now, with the newer version of R and tseries, this code hangs and doesnt give any result
>
>> garch(dflnRCLC1)
> ***** ESTIMATION WITH ANALYTICAL GRADIENT *****
> its hangs forever...
>
>
> What happens?
>
> Regards,
>
> Jos? Augusto Jr.
> University of S?o Paulo
>
> ______________________________________________
> 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.
>

-- 
Brian D. Ripley, ripley@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, UK Fax: +44 1865 272595

------------------------------

Message: 12
Date: Sun, 4 Nov 2007 15:15:11 +0000 (GMT)
From: Prof Brian Ripley 
Subject: Re: [R] structure vs. matrix
To: Duncan Murdoch 
Cc: r-help@stat.math.ethz.ch
Message-ID: 

Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Sun, 4 Nov 2007, Duncan Murdoch wrote:

> On 04/11/2007 1:28 AM, Edna Bell wrote:
>> Hi R Gurus!
>>
>> When creating a matrix, is it better to use the structure function or
>> the matrix function, please?
>
> I'd use the matrix() function. You can do it with structure(), and your
> code might be a little faster, but it will be harder to read, will break
> if someone ever changes the low-level implementation of matrices, e.g.
> by replacing it with the Matrix class.

For the record

A <- 
dim(A) <- c(nr, rc)

is faster than either matrix() or structure(), and seems at least as easy 
to read. matrix() has the advantage that it will replicate the data 
to the necessary length, but both will make copies that my version does 
not if you have the right length of data.

But this is only worth worrying about if you have large matrices.

-- 
Brian D. Ripley, ripley@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, UK Fax: +44 1865 272595



------------------------------

Message: 13
Date: Sun, 4 Nov 2007 16:34:40 +0000
From: "Gilbert G" 
Subject: [R] Why can repeated measures anova with within & between
subjects design not be done if group sizes are unbalanced?
To: r-help@r-project.org
Message-ID:

Content-Type: text/plain; charset=ISO-8859-1

Dear R people:

I wish to switch from SPSS to R, but there is one particular type of
ANOVA design that cannot be done in R. Or more likely, it can be
done, but it is nowhere documented.

The problem is typical for psychologists:
You have a repeated measures design with different groups of subjects.
Now, this can be done with the aov command, but the number of
subjects in both groups must be equal (i.e., balanced design). SPSS
allows for unbalanced designs as well.

If you are still with me, let me just give you an example of what R
can and cannot do so far. Imagine I have a 2x2 within subjects design
and I have 2 groups (e.g., group healthy and patients, which is stored
in MyGroup). And imagine I measure reaction time RT in four
conditions, say, in a color condition (red vs green) and in a shape
condition (square vs circle).

Now, in R you would have something like, as anybody who does balanced
repeated measures anova's might know:

aov( RT ~ color * shape * MyGroup + Error( Subjects/( color*shape) )

In spss you would have something like this (of course with the data
organized slightly differently :

GLM
x1 x2 x3 x4 BY MyGroup
/WSFACTOR = color 2 Polynomial shape 2 Polynomial
/METHOD = SSTYPE(3)
/CRITERIA = ALPHA(.05)
/WSDESIGN = color shape color*shape
/DESIGN = VAR00001 .

Ok, the question is. If the group sizes are different (say 10 people
in one group and 12 people in the other group) R is going to give the
wrong answer. Of course that is not R's fault.


=== message truncated ===

 __________________________________________________



	[[alternative HTML version deleted]]

