Re: [R] Sweave encoding option

2012-09-05 Thread Shi, Tao
Hi Yihui,

Thanks for your quick reply!  Yes, it was a long vacation, but definitely not 
long enough  :-).


Seriously, I have not changed my R, my tex engine etc.  Nothing.  And I was 
running the command just a couple of weeks ago and everything was fine.  But 
now I need to specify this encoding option

Still puzzled.

Tao





 From: Yihui Xie x...@yihui.name
To: Shi, Tao shida...@yahoo.com 
Cc: r-help@r-project.org r-help@r-project.org 
Sent: Tuesday, September 4, 2012 7:40 PM
Subject: Re: [R] Sweave encoding option
 
What happened might be that your vacation took too long. The encoding
argument was introduced in R 2.13.1 (July last year). Nothing has
changed in your Rnw document, but things have always been changing in
R, so the best thing to do is to check out help(Sweave).

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Tue, Sep 4, 2012 at 7:02 PM, Shi, Tao shida...@yahoo.com wrote:


 Hi list,

 I was running Sweave on one of my .rnw file.  Everything was fine, until I 
 came back from the vacation.  Nothing changed (at least to my knowledge), 
 but now I have this problem:

     Sweave(myfile.rnw)
 Error: ‘COLO001final.rnw’ is not ASCII and does not declare an encoding


 After snooping around on the web, I found this solution:

 Sweave(myfile.rnw, encoding=utf8)

 Now everything works fine.

 Could somebody explain to me what happened?  Why I need to specify the 
 encoding now for it to work?  What has changed (beyond my knowledge) in 
 my computer that is causing this error?

 I'm running R 2.15.1 on WinXP.

 Thanks!

 Tao

 __
 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] Read data from .csv file as a matrix and compare the different between two matrix

2012-09-05 Thread David Winsemius

On Sep 4, 2012, at 4:39 PM, s.s.m. fauzi wrote:

 Hi,
 I have two table matrix, and I would like to compare the different between
 two matrix.
 For example:
 
 Matrix 1:
A B C
 A 0  1 0
 B 0  0 1
 C 0  0  0
 
 Matrix 2:
   A B C
 A 0  1  0
 B 0  0  0
 C 0  0  0
 
 Each column which have value 1, should also return value 1. As in this
 case/example, the result should appear like this (as below). The result of
 this differentiation should also be in matrix table and should be write in .
 csv file.
 
 Result of the differences:

Differences? What differences?

If you examined the matrix returned by:

matrix1 == matrix2 it would look exactly like your desired result:


   A B C
 A 0  1  0
 B 0  0  0
 C 0  0  0
 
 At the mean time, I'm able to load the .csv file and convert it to matrix
 matrix1 -read.table(matrix1.csv, header=T, sep=,)
 matrix1 - as.matrix(matrix1)
 matrix2 - read.table(matrix2.csv, header=T, sep=,)
 matrix2 - as.matrix(matrix2)
 
 But, I can't find a suitable script to compare the differences between the
 matrix and write it to file.
 
 Appreciate any help from the expert
 
   [[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.

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] run EGARCH package on REXCEl

2012-09-05 Thread Ankit Mital
Hi,

I have limited experience on R and recently started using REXcel. Although I 
have been able to run both simple functions (like mean etc) and some complex 
ones (like Principal Component analysis, PCA) using RExcel, I am facing some 
problems while running EGARCH model. For this I have downloaded the 
'betategarch' package for R to run EGARCH with student t dist. Although the 
package has been installed properly, whenever I run function, I get an error 
saying - could not find function tegarch.est.

I'd appreciate any help on the above.
Regards
Ank




[[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] POSIXlt and daylight savings time

2012-09-05 Thread pdb
I'll rephrase the question...

If you try...

as.POSIXlt('2004-10-31 02:00:00') 

you get 

[1] 2004-10-31 

What do I need to do to make it return

[1] 2004-10-31 02:00:00 



--
View this message in context: 
http://r.789695.n4.nabble.com/POSIXlt-and-daylight-savings-time-tp4642253p4642272.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 to effectively remove Outliers from a binary logistic regression in R

2012-09-05 Thread Marcus Tullius
Hallo there,

 greetings from Germany.

 I have a simple question for you.

 I have run a binary logistic model, but there are lots of outliers distorting 
the real results.

 I have tried to get rid of the outliers using the following commands:

 remove = -c(56, 303, 365, 391, 512, 746, 859, 940, 1037, 1042, 1138, 1355)
 MIGRATION.rebuild - glm(MIGRATION, subset=remove)
 influence(MIGRATION.rebuild) 
 influence.measures(MIGRATION.rebuild)

 BUT it did not work.


 My question is:

 *Do you know a simple R-command which erases outliers and rebuilds the model 
without them?*

 I am including my model below so that you may have an idea of how I am trying 
to do it.

 Thanks in advance for your help.

 Francisco M. da Rocha

[[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] run EGARCH package on REXCEl

2012-09-05 Thread Patrick Burns

Ank,

Welcome to R.

I suspect that what you are missing is:

require(betategarch)

If you don't know it, you may be interested in
the blog post:

http://www.portfolioprobe.com/2012/07/06/a-practical-introduction-to-garch-modeling/

Also questions about garch are generally best
sent to R-sig-finance (you have to subscribe
before you can post).  Though if I'm correct
in my diagnosis, this was the right list for
this question.

Pat


On 05/09/2012 07:34, Ankit Mital wrote:

Hi,

I have limited experience on R and recently started using REXcel. Although I have been able to 
run both simple functions (like mean etc) and some complex ones (like Principal Component 
analysis, PCA) using RExcel, I am facing some problems while running EGARCH model. For this I 
have downloaded the 'betategarch' package for R to run EGARCH with student t dist. Although 
the package has been installed properly, whenever I run function, I get an error saying - 
could not find function tegarch.est.

I'd appreciate any help on the above.
Regards
Ank




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



--
Patrick Burns
pbu...@pburns.seanet.com
twitter: @portfolioprobe
http://www.portfolioprobe.com/blog
http://www.burns-stat.com
(home of 'Some hints for the R beginner'
and 'The R Inferno')

__
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 to effectively remove Outliers from a binary logistic regression in R

2012-09-05 Thread Jim Lemon

On 09/05/2012 05:40 PM, Marcus Tullius wrote:

Hallo there,

  greetings from Germany.

  I have a simple question for you.

  I have run a binary logistic model, but there are lots of outliers distorting 
the real results.

  I have tried to get rid of the outliers using the following commands:

  remove = -c(56, 303, 365, 391, 512, 746, 859, 940, 1037, 1042, 1138, 1355)
  MIGRATION.rebuild- glm(MIGRATION, subset=remove)
  influence(MIGRATION.rebuild)
  influence.measures(MIGRATION.rebuild)

  BUT it did not work.


  My question is:

  *Do you know a simple R-command which erases outliers and rebuilds the model 
without them?*

  I am including my model below so that you may have an idea of how I am trying 
to do it.


Hi Francisco,
Your model didn't make it to the help list, but I think that the problem 
is in your attempt to use the subset argument in glm. The vector is 
supposed to include the indices of the values that you _want_ in the 
analysis, and it looks like you are trying to remove the values that you 
_don't_ want. Say you have 2000 rows in your data frame in the model. 
The subset argument should look something like this:


glm(MIGRATION,
 subset=!(1:2000 %in% c(56,303,365,391,512,746,859,940,1037,1042,1138, 
1355))


Jim

__
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] Installing lumi and hdrcde

2012-09-05 Thread Hermann Norpois
To whom it may concern.

As I would like to analyse some array data I was keen on downloading the
lumi package that depends obviously on hdrcde that is not available for r
2.12.1. I did not find instructions to solve or circumvent this problem.
Installing hdrcde by hand did not work either. It was not detected by
 (.packages(all.available=TRUE))
if installed in the R library.

Thanks
Hermann Norpois

This was my try to install the lumi package:

 source (http://bioconductur.org/biocLite.R;)
Fehler in file(filenaReme, r, encoding = encoding) :
  kann Verbindung nicht öffnen
Zusätzlich: Warnmeldung:
In file(filename, r, encoding = encoding) :
  kann 'bioconductur.org' nicht auflösen
 source (http://bioconductor.org/biocLite.R;)
BiocInstaller version 1.2.1, ?biocLite for help
 biocLite(lumi)
BioC_mirror: 'http://www.bioconductor.org'
Using R version 2.14, BiocInstaller version 1.2.1.
Installing package(s) 'lumi'
Installing package(s) into ‘/home/hnorpois/R/i686-pc-
linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
Warnung: dependency ‘hdrcde’ is not available
versuche URL '
http://www.bioconductor.org/packages/2.9/bioc/src/contrib/lumi_2.6.0.tar.gz'
Content type 'application/x-gzip' length 11386679 bytes (10.9 Mb)
URL geöffnet
==
downloaded 10.9 Mb

ERROR: dependency ‘hdrcde’ is not available for package ‘lumi’
* removing ‘/home/hnorpois/R/i686-pc-linux-gnu-library/2.14/lumi’

The downloaded packages are in
‘/tmp/RtmpMNrvTz/downloaded_packages’
Warnmeldungen:
1: In install.packages(pkgs = pkgs, repos = repos, ...) :
  installation of package ‘lumi’ had non-zero exit status
2: 'rgl' cannot be updated, installed directory '/usr/lib/R/site-library'
not
  writeable

[[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] linking HTML with R

2012-09-05 Thread punitha
hi,

 I am said to create a small form in html and after i click the submit
button it should execute R function and move to next page of html

 can I know how can it be done???
  can we link R and HTML???
 which packages will help me in doing this???
 are there any examples similar to this online???

Thanks in advance


with regards,
C. Punitha



-
Thank you,

with regards,
Punitha
--
View this message in context: 
http://r.789695.n4.nabble.com/linking-HTML-with-R-tp4642276.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] Mailing List

2012-09-05 Thread Marcus Tullius
Hello there,

 is there a way I can erase my name from the mailing list and still get mails 
concerning the topics

 I am interested in? I cannot handle all those emails coming in constantly. I 
do not have time for that.

 Greetings,
 Francisco

[[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] POSIXlt and daylight savings time

2012-09-05 Thread Rui Barradas

Hello,

Jeff already answered to your question,

as.POSIXlt('2004-10-31 02:00:00', format = %Y-%m-%d %H:%M:%S)

And in my system and timezone (GMT) I get
as.POSIXlt('2004-10-31 02:00:00')
[1] 2004-10-31 02:00:00

So Jeff's point (b) should also be followed.

sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252
[3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Portugal.1252

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

loaded via a namespace (and not attached):
[1] fortunes_1.4-2 tools_2.15.1

Hope this helps,

Rui Barradas

Em 05-09-2012 09:24, pdb escreveu:

I'll rephrase the question...

If you try...

as.POSIXlt('2004-10-31 02:00:00')

you get

[1] 2004-10-31

What do I need to do to make it return

[1] 2004-10-31 02:00:00



--
View this message in context: 
http://r.789695.n4.nabble.com/POSIXlt-and-daylight-savings-time-tp4642253p4642272.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] predict rpart newdata - introduce only values variables used in the tree

2012-09-05 Thread RP
agent dunham crosspide at hotmail.com writes:

 I've a tree which included at first 23 variables. Then I've pruned this
 tree, and there are only 8 variables involved. 

Are you sure the others are not being considered as surrogate variables?

 Is there a way to introduce only this 8 values?

No. Why? See my previous answer.

__
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] Read data from .csv file as a matrix and compare the different between two matrix

2012-09-05 Thread Rui Barradas

Hello,

Em 05-09-2012 07:26, David Winsemius escreveu:

On Sep 4, 2012, at 4:39 PM, s.s.m. fauzi wrote:


Hi,
I have two table matrix, and I would like to compare the different between
two matrix.
For example:

Matrix 1:
A B C
A 0  1 0
B 0  0 1
C 0  0  0

Matrix 2:
   A B C
A 0  1  0
B 0  0  0
C 0  0  0

Each column which have value 1, should also return value 1. As in this
case/example, the result should appear like this (as below). The result of
this differentiation should also be in matrix table and should be write in .
csv file.

Result of the differences:

Differences? What differences?


In fact, this doesn't seem to be a differences problem, but a logical one:
- result is 1 iff both operands are 1.
So the solution could be

# multiply to return an integer, not T/F
1*(matrix1  matrix2)

Rui Barradas



If you examined the matrix returned by:

matrix1 == matrix2 it would look exactly like your desired result:



   A B C
A 0  1  0
B 0  0  0
C 0  0  0

At the mean time, I'm able to load the .csv file and convert it to matrix
matrix1 -read.table(matrix1.csv, header=T, sep=,)
matrix1 - as.matrix(matrix1)
matrix2 - read.table(matrix2.csv, header=T, sep=,)
matrix2 - as.matrix(matrix2)

But, I can't find a suitable script to compare the differences between the
matrix and write it to file.

Appreciate any help from the expert

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

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-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] Mailing List

2012-09-05 Thread Jessica Streicher
Since noone but you knows what you are interested in - unlikely.

You could try to set up your mailclient with rules, deleting mails coming from 
the list that do not contain certain keywords.

On 05.09.2012, at 12:00, Marcus Tullius wrote:

 Hello there,
 
 is there a way I can erase my name from the mailing list and still get mails 
 concerning the topics
 
 I am interested in? I cannot handle all those emails coming in constantly. I 
 do not have time for that.
 
 Greetings,
 Francisco
 
   [[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] repace values in raster based on values in another raster

2012-09-05 Thread PIKAL Petr
Hi

The key information is how landuse.raster and fire.did.not.occurr objects looks 
like.
e.g. for matrix you can do

 set.seed(333)
 mat-matrix(rnorm(20),5,4)
 mat[mat0]-NA
 fat-matrix(sample(1:5, 20, replace=T),5,4)
 lat-100
 mat[fat==1]-lat
 mat
[,1][,2]   [,3][,4]
[1,] -0.08281164 100.000 -1.1249003 100.000
[2,]  NA  NA -0.8743036  NA
[3,] -2.05128979  NA NA  NA
[4,]  NA  NA -0.5839751 100.000
[5,] -1.52596060  -0.5604825 -0.8232986  -0.3804572

if lat is one value. If it is matrix with the same dimensions as mat you need 
to do it differently.

 lat-matrix(runif(20)*100, 5,4)
 mat[fat==1]-lat
Warning message:
In mat[fat == 1] - lat :
  number of items to replace is not a multiple of replacement length
 mat
[,1]   [,2]   [,3]   [,4]
[1,] -0.08281164 24.1093483 -1.1249003 38.9556712
[2,]  NA NA -0.8743036 NA
[3,] -2.05128979 NA NA NA
[4,]  NA NA -0.5839751 61.7859617
[5,] -1.52596060 -0.5604825 -0.8232986 -0.3804572

 mat[which(fat==1)]-lat[which(fat==1)]
 mat
[,1]   [,2]   [,3]   [,4]
[1,] -0.08281164 41.0170721 -1.1249003 15.3955547
[2,]  NA NA -0.8743036 NA
[3,] -2.05128979 NA NA NA
[4,]  NA NA -0.5839751  3.0707204
[5,] -1.52596060 -0.5604825 -0.8232986 -0.3804572

Regards
Petr



 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org] On Behalf Of sean_parks
 Sent: Wednesday, September 05, 2012 12:58 AM
 To: r-help@r-project.org
 Subject: [R] repace values in raster based on values in another raster
 
 Hi,
 
 I am attempting to create a new raster based on values of another
 raster.
 
 In the Arc world, this is called a conditional statement or con
 statement.
 
 I am having quite a bit of difficulty figuring this out in R.
 
 Here is some pseudo-code:
 if (fire.did.not.occurr == 1)
 then (new. raster = landuse.raster)
 
 Here is some real code and the associated error:
  landuse.raster - raster(C:/temp/landuse.raster.tif)
  new.raster - landuse.raster
  new.raster[new.raster  0] - NA
  new.raster[fire.did.not.occurr == 1] - landuse.raster
 Error in x@data@values[i] - value :
   incompatible types (from S4 to integer) in subassignment type fix
 
 If I replace the landuse.raster with a specific number in the final
 command, then the operation works, but I would like to replace with the
 values in the landuse.raster.
 
 Please help.
 
 FYI: Please know that I have searched the forums and have not found
 anything helpful. Perhaps I am using incorrect search criteria.
 
 Thanks,
 Sean
 
 
 
 
 
 --
 View this message in context: http://r.789695.n4.nabble.com/repace-
 values-in-raster-based-on-values-in-another-raster-tp4642245.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] Mailing List

2012-09-05 Thread David Winsemius

On Sep 5, 2012, at 3:00 AM, Marcus Tullius wrote:

 Hello there,
 
 is there a way I can erase my name from the mailing list and still get mails 
 concerning the topics

If you change your subscription options to daily digest ( at the page where you 
signed up), you can just read the top of the digest.
 
 I am interested in? I cannot handle all those emails coming in constantly. I 
 do not have time for that.
 
 Greetings,
 Francisco
 

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] cenboxplot(): Reporting Limit Twice Correct Concentration [RESOLVED]

2012-09-05 Thread Rich Shepard

On Wed, 5 Sep 2012, Nordlund, Dan (DSHS/RDA) wrote:


The line is drawn at 0.01 because there is a censored record where quant=0.01, 
i.e.


sb.t[which(sb.t$quant==0.01  sb.t$ceneq1==TRUE),]

 site   sampdateera param quant ceneq1 floor ceiling
34169 MW-5 1995-01-10 Pre-mining SbTot  0.01   TRUE 00.01


Dan,

  Thanks for seeing what I missed evary time I went though the data. I knew
it had to be some mis-classified observation but after three times through I
thought that I had corrected all the misfits and didn't see that one. New
eyeballs are invaluable after one's looked at data or code a long time.

Very much appreciated,

Rich

__
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] Histogram to KDE

2012-09-05 Thread firdaus.janoos
On Fri, Aug 31, 2012 at 12:15 PM, David L Carlson dcarl...@tamu.edu wrote:

 Using a data.frame x with columns bins and counts:

 x - structure(list(bins = c(3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5,
 11.5, 12.5, 13.5, 14.5, 15.5), counts = c(1, 1, 2, 3, 6, 18,
 19, 23, 8, 10, 6, 2, 1)), .Names = c(bins, counts), row.names =
 4:16,
 class = data.frame)

 This will give you a plot of the kde estimate:


Thanks.


 xkde - density(rep(bins, counts), bw=SJ)
 plot(xkde)

 As for the standard error or the confidence interval, you would probably
 need to use bootstrapping.



 On a similar note - is there a way in R to directly resample /
cross-validate from a histogram of a data-set without recreating the
original data-set ?


   -Original Message-
 
  Hello,
  I wanted to know if there was way to convert a histogram of a data-set
  to a
  kernel density estimate directly in R ?
 
  Specifically, I have a histogram [bins, counts] of samples {X1 ...
  XN} of a quantized variable X where there is one bin for each level of
  X,
  and I'ld like to directly get a kde estimate of the pdf of X from the
  histogram. Therefore, there is no additional quantization of X in the
  histogram. Most KDE methods in R seem to require the original sample
  set   - and I would like to avoid re-creating the samples from the
  histogram. Is there some quick way of doing this using one of the
  standard
  kde methods in R ?
 
  Also, a general statistical question - is there some measure of the
  standard error or confidence interval or similar of a KDE of a data-set
  ?
 
  Thanks,
  -fj
 


[[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] Installing lumi and hdrcde

2012-09-05 Thread Uwe Ligges



On 05.09.2012 11:41, Hermann Norpois wrote:

To whom it may concern.

As I would like to analyse some array data I was keen on downloading the
lumi package that depends obviously on hdrcde that is not available for r
2.12.1. I did not find instructions to solve or circumvent this problem.
Installing hdrcde by hand did not work either. It was not detected by

(.packages(all.available=TRUE))

if installed in the R library.

Thanks
Hermann Norpois

This was my try to install the lumi package:


source (http://bioconductur.org/biocLite.R;)


This can easily be solved by using the correct spelling for bioconductor.


Uwe Ligges


Fehler in file(filenaReme, r, encoding = encoding) :
   kann Verbindung nicht öffnen
Zusätzlich: Warnmeldung:
In file(filename, r, encoding = encoding) :
   kann 'bioconductur.org' nicht auflösen

source (http://bioconductor.org/biocLite.R;)

BiocInstaller version 1.2.1, ?biocLite for help

biocLite(lumi)

BioC_mirror: 'http://www.bioconductor.org'
Using R version 2.14, BiocInstaller version 1.2.1.
Installing package(s) 'lumi'
Installing package(s) into ‘/home/hnorpois/R/i686-pc-
linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
Warnung: dependency ‘hdrcde’ is not available
versuche URL '
http://www.bioconductor.org/packages/2.9/bioc/src/contrib/lumi_2.6.0.tar.gz'
Content type 'application/x-gzip' length 11386679 bytes (10.9 Mb)
URL geöffnet
==
downloaded 10.9 Mb

ERROR: dependency ‘hdrcde’ is not available for package ‘lumi’
* removing ‘/home/hnorpois/R/i686-pc-linux-gnu-library/2.14/lumi’

The downloaded packages are in
 ‘/tmp/RtmpMNrvTz/downloaded_packages’
Warnmeldungen:
1: In install.packages(pkgs = pkgs, repos = repos, ...) :
   installation of package ‘lumi’ had non-zero exit status
2: 'rgl' cannot be updated, installed directory '/usr/lib/R/site-library'
not
   writeable

[[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] Smooth contour of a matrix

2012-09-05 Thread oliverjack38
Hi R users

I'm looking for a way to do a contour plot of the attached 2D matrix. Using
contour() gives me some ugly contour lines that I would like to smooth. Any
ideas?

oliverjack38


http://r.789695.n4.nabble.com/file/n4642291/param1-4.txt param1-4.txt 



--
View this message in context: 
http://r.789695.n4.nabble.com/Smooth-contour-of-a-matrix-tp4642291.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] Mailing List

2012-09-05 Thread Keith Jewell
You might prefer to read list via the web or a news reader or an RSS 
feed, in which case http://dir.gmane.org/gmane.comp.lang.r.general might 
be helpful.


Keith J

On 05/09/2012 13:47, David Winsemius wrote:


On Sep 5, 2012, at 3:00 AM, Marcus Tullius wrote:


Hello there,

is there a way I can erase my name from the mailing list and still get mails 
concerning the topics


If you change your subscription options to daily digest ( at the page where you 
signed up), you can just read the top of the digest.


I am interested in? I cannot handle all those emails coming in constantly. I do 
not have time for that.

Greetings,
Francisco



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] cex.lab ignored in plot.zoo for multiple plots

2012-09-05 Thread Nicolai Schneider
Hello everyone,

a problem with the plot.zoo function. In the parameters of the function,
cex.lab is ignored. I tried to reduce the size of the yaxis labels by at
least 50%.

--

Example:

sample - as.zoo(EuStockMarkets)

par(las=1)

plot.zoo(sample, plot.type=multiple, main=Time Series, xlab=Date,
yaxt=n, cex.lab=0.5, xaxs=i)
# Try playing with different values for cex.lab

par(las=0)

---

Any hints or suggestions?

THX Nico

[[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] linking HTML with R

2012-09-05 Thread info
Hi,
I think the simplest way to do this is using a small piece of php code.

See
http://stats.stackexchange.com/questions/4279/how-can-i-integrate-r-with-php

There are several webpages about this topic, but all of them are very
ancient. I have the plan to write a text about this

Greetz
Frans
www.digipsy.nl

-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
Namens punitha
Verzonden: woensdag 5 september 2012 11:49
Aan: r-help@r-project.org
Onderwerp: [R] linking HTML with R

hi,

 I am said to create a small form in html and after i click the submit
button it should execute R function and move to next page of html

 can I know how can it be done???
  can we link R and HTML???
 which packages will help me in doing this???
 are there any examples similar to this online???

Thanks in advance


with regards,
C. Punitha



-
Thank you,

with regards,
Punitha
--
View this message in context:
http://r.789695.n4.nabble.com/linking-HTML-with-R-tp4642276.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] Improvement of Regression Model

2012-09-05 Thread Vignesh Prajapati
Hello folks,

I am on learning phase of R. I have developed Regression Model over six
predictor variables. while development, i found my all data are not very
linear. So, may because of this the prediction of my model is not exact.

   Here is the summary of model :
Call:
lm(formula = y ~ x_1 + x_2 + x_3 + x_4 + x_5 + x_6)

Residuals:
 Min   1Q   Median   3Q  Max
-125.302  -26.2100.702   26.261  111.511

Coefficients:
Estimate Std. Error t value Pr(|t|)
(Intercept) 48.629440.27999 173.684   2e-16 ***
x_1 -0.678310.08053  -8.423   2e-16 ***
x_2  0.074760.49578   0.151 0.880143
x_3 -0.229810.06489  -3.541 0.000399 ***
x_4  0.018450.09070   0.203 0.838814
x_5  3.769520.67006   5.626 1.87e-08 ***
x_6  0.076980.01565   4.919 8.75e-07 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 33.76 on 19710 degrees of freedom
Multiple R-squared: 0.006298, Adjusted R-squared: 0.005995
F-statistic: 20.82 on 6 and 19710 DF,  p-value:  2.2e-16

I have certain questions with this model

1. Any way to improve the accuracy of this model?
2.Which of the value is most useful among Residual standard error,degrees
of freedom, Multiple R-squared, Adjusted R-squared, F-statisti,  p-value
for choosing best model from numbers of model ?
3.Is it appropriate to use polynomial model with these data?
4.In case when i am using polynomial model for regression, which degree is
most appropriate for it?


Thanks
Vignesh
attachment: Rplot.pngattachment: Rplot01.pngattachment: Rplot02.pngattachment: Rplot03.pngattachment: Rplot04.pngattachment: Rplot05.png__
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] Installing lumi and hdrcde

2012-09-05 Thread Martin Morgan

On 09/05/2012 02:41 AM, Hermann Norpois wrote:

To whom it may concern.

As I would like to analyse some array data I was keen on downloading the
lumi package that depends obviously on hdrcde that is not available for r
2.12.1. I did not find instructions to solve or circumvent this problem.
Installing hdrcde by hand did not work either. It was not detected by

(.packages(all.available=TRUE))

if installed in the R library.

Thanks
Hermann Norpois

This was my try to install the lumi package:


source (http://bioconductur.org/biocLite.R;)

Fehler in file(filenaReme, r, encoding = encoding) :
   kann Verbindung nicht öffnen
Zusätzlich: Warnmeldung:
In file(filename, r, encoding = encoding) :
   kann 'bioconductur.org' nicht auflösen

source (http://bioconductor.org/biocLite.R;)

BiocInstaller version 1.2.1, ?biocLite for help

biocLite(lumi)

BioC_mirror: 'http://www.bioconductor.org'
Using R version 2.14, BiocInstaller version 1.2.1.
Installing package(s) 'lumi'
Installing package(s) into ‘/home/hnorpois/R/i686-pc-
linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
Warnung: dependency ‘hdrcde’ is not available
versuche URL '
http://www.bioconductor.org/packages/2.9/bioc/src/contrib/lumi_2.6.0.tar.gz'
Content type 'application/x-gzip' length 11386679 bytes (10.9 Mb)
URL geöffnet
==
downloaded 10.9 Mb

ERROR: dependency ‘hdrcde’ is not available for package ‘lumi’
* removing ‘/home/hnorpois/R/i686-pc-linux-gnu-library/2.14/lumi’


If I use R-2.14 and

  install.packages(hdrcde, repos=http://cran.fhcrc.org;)

I get

In getDependencies(pkgs, dependencies, available, lib) :
  package 'hdrcde' is not available (for R version 2.14.0 alpha)

but if I use R-2.15 the package installs correctly. Likewise with 
biocLite(lumi).


So I think the easiest solution is to use a current version of R.

Please ask questions about Bioconductor packages on the Bioconductor 
mailing list http://bioconductor.org/help/mailing-list/


Martin





The downloaded packages are in
 ‘/tmp/RtmpMNrvTz/downloaded_packages’
Warnmeldungen:
1: In install.packages(pkgs = pkgs, repos = repos, ...) :
   installation of package ‘lumi’ had non-zero exit status
2: 'rgl' cannot be updated, installed directory '/usr/lib/R/site-library'
not
   writeable

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




--
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

__
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] Horizontal grid in background of barplot

2012-09-05 Thread Cable, Sam B Civ USAF AFMC AFRL/RVBXI
A horribly pedestrian alternative to plotrix:

 

barplot(x,beside=TRUE,  ylim=c(0,90),  etc.)

par('usr')# just getting plot limits

[1]  0.44  15.56  0.00  90.00

par(new=T)

lines(c(0.44,15.56),c(20,20))

lines(c(0.44,15.56),c(40,40))

etc.


[[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] Improvement of Regression Model

2012-09-05 Thread Bert Gunter
These questions are off topic for this list. Try a statistical list
like stats.stackexchange.com.

Probably better yet, as your statistical skills sound like they are
somewhat limited, consult a local statistician for help.

-- Bert

On Wed, Sep 5, 2012 at 7:54 AM, Vignesh Prajapati vign...@tatvic.com wrote:

 Hello folks,

 I am on learning phase of R. I have developed Regression Model over six
 predictor variables. while development, i found my all data are not very
 linear. So, may because of this the prediction of my model is not exact.

Here is the summary of model :
 Call:
 lm(formula = y ~ x_1 + x_2 + x_3 + x_4 + x_5 + x_6)

 Residuals:
  Min   1Q   Median   3Q  Max
 -125.302  -26.2100.702   26.261  111.511

 Coefficients:
 Estimate Std. Error t value Pr(|t|)
 (Intercept) 48.629440.27999 173.684   2e-16 ***
 x_1 -0.678310.08053  -8.423   2e-16 ***
 x_2  0.074760.49578   0.151 0.880143
 x_3 -0.229810.06489  -3.541 0.000399 ***
 x_4  0.018450.09070   0.203 0.838814
 x_5  3.769520.67006   5.626 1.87e-08 ***
 x_6  0.076980.01565   4.919 8.75e-07 ***
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

 Residual standard error: 33.76 on 19710 degrees of freedom
 Multiple R-squared: 0.006298, Adjusted R-squared: 0.005995
 F-statistic: 20.82 on 6 and 19710 DF,  p-value:  2.2e-16

 I have certain questions with this model

 1. Any way to improve the accuracy of this model?
 2.Which of the value is most useful among Residual standard error,degrees
 of freedom, Multiple R-squared, Adjusted R-squared, F-statisti,  p-value
 for choosing best model from numbers of model ?
 3.Is it appropriate to use polynomial model with these data?
 4.In case when i am using polynomial model for regression, which degree is
 most appropriate for it?


 Thanks
 Vignesh

 __
 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] Improvement of Regression Model

2012-09-05 Thread Jeff Newmiller
a) This sounds like homework. This is not a homework support forum.

b) If it is not homework, you should take one or more classes on statistics. 
Your questions are more about theory than R and this is not a statistics theory 
mailing list.

c) You ask questions about the use of your data, but you provide no data or 
reproducible, self-contained R code, so even if it is not homework you are not 
providing us with a sporting chance at understanding your questions.  Read the 
Posting Guide.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  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.

Vignesh Prajapati vign...@tatvic.com wrote:

Hello folks,

I am on learning phase of R. I have developed Regression Model over six
predictor variables. while development, i found my all data are not
very
linear. So, may because of this the prediction of my model is not
exact.

   Here is the summary of model :
Call:
lm(formula = y ~ x_1 + x_2 + x_3 + x_4 + x_5 + x_6)

Residuals:
 Min   1Q   Median   3Q  Max
-125.302  -26.2100.702   26.261  111.511

Coefficients:
Estimate Std. Error t value Pr(|t|)
(Intercept) 48.629440.27999 173.684   2e-16 ***
x_1 -0.678310.08053  -8.423   2e-16 ***
x_2  0.074760.49578   0.151 0.880143
x_3 -0.229810.06489  -3.541 0.000399 ***
x_4  0.018450.09070   0.203 0.838814
x_5  3.769520.67006   5.626 1.87e-08 ***
x_6  0.076980.01565   4.919 8.75e-07 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 33.76 on 19710 degrees of freedom
Multiple R-squared: 0.006298, Adjusted R-squared: 0.005995
F-statistic: 20.82 on 6 and 19710 DF,  p-value:  2.2e-16

I have certain questions with this model

1. Any way to improve the accuracy of this model?
2.Which of the value is most useful among Residual standard
error,degrees
of freedom, Multiple R-squared, Adjusted R-squared, F-statisti, 
p-value
for choosing best model from numbers of model ?
3.Is it appropriate to use polynomial model with these data?
4.In case when i am using polynomial model for regression, which degree
is
most appropriate for it?


Thanks
Vignesh




__
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 to visualise the smoothers of a model averaged GAM ?

2012-09-05 Thread fmoreira
Hi,

It is not clear to me what a model-averaged (sensu MuMIn package) GAM is...
How is the smoother averaged and how can I see it ?

My model is:

M.gam.auto - gam (Leksite ~ s(Altmean,k=4) + s(Class_unfav_prop, k=4) + 
   + s(Visib2000, k=4) + s(Ddisturbance, k=4) + s(Steppe_prop,
k=4)
  + s(autocov2, k=4), family=binomial, data= leks)

When i extract the confidence intervals for the average models (all models
with delta AIC 2), I get:

 confint (avgmod)
 2.5 %   97.5 %
(Intercept)   -0.705495919  0.090974395
s(Altmean).1  -1.032000478  0.846255206
s(Altmean).2  -0.131526964  3.181165030
s(Altmean).3  -0.479038766  1.511470593
s(autocov2).1 -0.594732400  5.030680753
s(autocov2).2 -3.932830030 18.377288299
s(autocov2).3 -5.859925892  3.269061133
s(Ddisturbance).1 -0.324700903  0.609412974
s(Ddisturbance).2 -0.016172651  5.880936668
s(Ddisturbance).3 -0.881357264  0.862160976
s(Steppe_prop).1  -0.002864215  0.002861629
s(Steppe_prop).2  -0.022374707  0.022389396
s(Steppe_prop).3   0.191842041  1.242861265
s(Class_unfav_prop).1 -0.119628517  0.109562147
s(Class_unfav_prop).2 -0.246237564  0.274136388
s(Class_unfav_prop).3 -0.588583036  0.189353845
s(Visib2000).1-0.003592773  0.003593891
s(Visib2000).2-0.012680896  0.012686619
s(Visib2000).3-0.489773942  0.206553913

Not sure of this means nor how to visualize the smoothers...
Help would be appreciated.


Francisco Moreira
Institute of Agronomy
Technical University of Lisbon



--
View this message in context: 
http://r.789695.n4.nabble.com/how-to-visualise-the-smoothers-of-a-model-averaged-GAM-tp4642302.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 to visualise the smoothers of a model averaged GAM ?

2012-09-05 Thread Youssef
Hi,
If i understand what you mean, you can do 
Plot(M.gam.auto)
You Will get the centered predictions for smooths, you can also extract 
predictions for each term using (predict(M.gam.auto, type=terms)).

The results you got are thé coefficients for each of you smooths pieces (as 
k=4, you get 3), but they re not interpretable as they are.

Hope this could help

Youssef

Le 2012-09-05 à 11:50, fmoreira fmore...@isa.utl.pt a écrit :

 Hi,
 
 It is not clear to me what a model-averaged (sensu MuMIn package) GAM is...
 How is the smoother averaged and how can I see it ?
 
 My model is:
 
 M.gam.auto - gam (Leksite ~ s(Altmean,k=4) + s(Class_unfav_prop, k=4) + 
   + s(Visib2000, k=4) + s(Ddisturbance, k=4) + s(Steppe_prop,
 k=4)
  + s(autocov2, k=4), family=binomial, data= leks)
 
 When i extract the confidence intervals for the average models (all models
 with delta AIC 2), I get:
 
 confint (avgmod)
 2.5 %   97.5 %
 (Intercept)   -0.705495919  0.090974395
 s(Altmean).1  -1.032000478  0.846255206
 s(Altmean).2  -0.131526964  3.181165030
 s(Altmean).3  -0.479038766  1.511470593
 s(autocov2).1 -0.594732400  5.030680753
 s(autocov2).2 -3.932830030 18.377288299
 s(autocov2).3 -5.859925892  3.269061133
 s(Ddisturbance).1 -0.324700903  0.609412974
 s(Ddisturbance).2 -0.016172651  5.880936668
 s(Ddisturbance).3 -0.881357264  0.862160976
 s(Steppe_prop).1  -0.002864215  0.002861629
 s(Steppe_prop).2  -0.022374707  0.022389396
 s(Steppe_prop).3   0.191842041  1.242861265
 s(Class_unfav_prop).1 -0.119628517  0.109562147
 s(Class_unfav_prop).2 -0.246237564  0.274136388
 s(Class_unfav_prop).3 -0.588583036  0.189353845
 s(Visib2000).1-0.003592773  0.003593891
 s(Visib2000).2-0.012680896  0.012686619
 s(Visib2000).3-0.489773942  0.206553913
 
 Not sure of this means nor how to visualize the smoothers...
 Help would be appreciated.
 
 
 Francisco Moreira
 Institute of Agronomy
 Technical University of Lisbon
 
 
 
 --
 View this message in context: 
 http://r.789695.n4.nabble.com/how-to-visualise-the-smoothers-of-a-model-averaged-GAM-tp4642302.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] cex.lab ignored in plot.zoo for multiple plots

2012-09-05 Thread David Winsemius

On Sep 5, 2012, at 8:06 AM, Nicolai Schneider wrote:

 Hello everyone,
 
 a problem with the plot.zoo function. In the parameters of the function,
 cex.lab is ignored. I tried to reduce the size of the yaxis labels by at
 least 50%.
 
 --
 
 Example:
 
 sample - as.zoo(EuStockMarkets)
 
 par(las=1)
 
 plot.zoo(sample, plot.type=multiple, main=Time Series, xlab=Date,
 yaxt=n, cex.lab=0.5, xaxs=i)
 # Try playing with different values for cex.lab

I would have thought that the parameter to use would be 'cex.axis'. Testing 
seems to confirm theory in this case.
 
 par(las=0)
 
 ---
-- 
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 to visualise the smoothers of a model averaged GAM ?

2012-09-05 Thread fmoreira
Maybe I should have added further details to my previous message.

So, after running

dd - dredge (M.gam.auto)
avgmod - model.avg(dd, subset = delta  2)


I ask for the confidence intervals using

 confint (avgmod) 

What you are suggesting would result in the visualization of the initial
model, not of this averaged one...right?




--
View this message in context: 
http://r.789695.n4.nabble.com/how-to-visualise-the-smoothers-of-a-model-averaged-GAM-tp4642302p4642307.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.table (anova)

2012-09-05 Thread Dominic Roye
Hello everybody,

I have a problem with the model.table of anova.

I have data (datos2) with 4 cluster (V7), calculated with daisy and hclust.

str(datos2)
'data.frame':   56 obs. of  7 variables:
 $ Estacion: Factor w/ 56 levels Abradelo,AltoDoRodicio,..: 1 2 3 4 5 6
7 8 9 10 ...
 $ Invierno: num  36 53.9 37.1 63.6 12.5 ...
 $ X   : int  643449 616292 562796 669916 625025 631194 511201 524431
641809 590324 ...
 $ X.1 : int  4734442 4684126 4696309 4743224 4723028 4833932 4649389
4701030 4706108 4765782 ...
 $ X.2 : int  826 981 553 1364 432 421 473 424 697 731 ...
 $ X.3 : num  87961 82902 30608 84260 94169 ...
 $ V7  : int  1 1 2 1 3 4 2 2 1 4 ...


I made the anova test:

sig.test - aov(V7~Invierno+X+X.1+X.2+X.3,data=datos2)

 summary(sig.test)
Df Sum Sq Mean Sq F value   Pr(F)
Invierno 1   0.010.01   0.014   0.9064
X1   0.810.81   1.784   0.1877
X.1  1  32.61   32.61  72.026 2.97e-11 ***
X.2  1   1.401.40   3.098   0.0845 .
X.3  1   0.740.74   1.639   0.2063
Residuals   50  22.640.45
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1



Now i would like to now the differences between each cluster, for this
model.tables:

mod - model.tables(sig.test,mean)


Tables of means
Grand mean

2.178571

 Invierno
Invierno
3.642384106 5.849889625 7.726269316 8.830022075 10.04415011 10.15452539
 2.1615  2.1628  2.1639  2.1646  2.1653  2.1653
 11.9205298 12.25165563 12.47240618 13.35540839 13.90728477 14.34878587
 2.1664  2.1666  2.1667  2.1672  2.1676  2.1678
 14.6799117 15.56291391 16.11479029 18.98454746 19.09492274 20.52980132
 2.1680  2.1686  2.1689  2.1706  2.1707  2.1715
23.73068433 24.28256071 24.39293598 25.05518764 25.71743929  26.1589404
 2.1734  2.1737  2.1738  2.1742  2.1746  2.1749
26.26931567 29.13907285 29.69094923  29.8013245 31.01545254 33.99558499
 2.1749  2.1766  2.1770  2.1770  2.1777  2.1795
 35.7615894 35.98233996 36.42384106 37.08609272  38.0794702 39.18322296
 2.1806  2.1807  2.1810  2.1814  2.1819  2.1826
44.81236203 45.36423841 49.88962472 51.87637969 53.09050773 53.42163355
 2.1859  2.1863  2.1890  2.1901  2.1909  2.1911
53.75275938 53.86313466 54.52538631 54.74613687 57.61589404 58.60927152
 2.1913  2.1913  2.1917  2.1919  2.1936  2.1942
60.26490066 63.35540839 63.57615894 64.56953642
 2.1951  2.1970  2.1971  2.1977

 X
X
497771 505372 508273 510859 511201 513379 516145 518427 524431 525267
526634
2.3693 2.3603 2.3464 2.3529 2.3850 2.3565 2.3218 2.3784 2.3245 2.3400
2.3120
531549 536101 540986 544158 547280 549546 555930 558736 560019 560578
562796
2.3085 2.2778 2.2838 2.2569 2.2480 2.2909 2.2708 2.2397 2.2067 2.2101
2.2390
570876 574209 576464 583167 585343 585393 589733 590324 594370 597892
598421
2.1876 2.2207 2.2228 2.1681 2.1689 2.2040 2.1982 2.1907 2.1252 2.1852
2.1306
598945 612930 613230 615988 616292 618769 623277 625025 625827 631194
632785
2.1654 2.0910 2.1139 2.1112 2.1276 2.0689 2.0768 2.0578 2.1086 2.0921
2.0430
636959 639190 639736 640275 641809 643449 648423 654995 657933 664123
669916
2.0585 2.0225 2.0379 2.0679 2.0327 2.0401 2.0285 1.9861 1.9910 2.0179
2.0076
670351
1.9719

 X.1
X.1
4639803 4644255 4648384 4649389 4658771 4664595 4669787 4669863 4674072
4675170
  0.871   0.969   0.964   1.144   1.293   1.143   1.334   1.199   1.554
1.500
4676811 4684126 4685177 4688943 4691376 4692421 4695132 4696309 4698702
4701030
  1.360   1.425   1.565   1.612   1.425   1.802   1.533   1.721   1.822
1.870
4702027 4703493 4703623 4706108 4711638 4714422 4717609 4718574 4720490
4723028
  1.853   1.623   1.728   1.726   2.095   2.102   1.855   2.057   2.046
2.013
4732806 4734442 4741204 4741500 4743224 4747354 4751251 4757557 4761493
4765782
  2.264   2.097   2.281   2.418   2.123   2.512   2.469   2.681   2.561
2.600
4771652 4775147 4777923 4780523 4786917 4788103 4798361 4799728 4812691
4815885
  2.817   2.828   2.809   2.755   2.881   3.046   3.225   3.060   3.173
3.421
4822868 4824470 4827467 4833932 4835419 4839683
  3.330   3.385   3.417   3.460   3.535   3.647

.
.
.


str(mod)
List of 2
 $ tables:List of 6
  ..$ Grand mean: num 2.18
  ..$ Invierno  : mtable [1:52(1d)] 2.16 2.16 2.16 2.16 2.17 ...
  .. ..- attr(*, dimnames)=List of 1
  .. .. ..$ Invierno: chr [1:52] 3.642384106 5.849889625 7.726269316
8.830022075 ...
  ..$ X : mtable [1:56(1d)] 2.37 2.36 2.35 2.35 2.39 ...
  .. ..- attr(*, dimnames)=List of 1
  .. .. ..$ X: chr [1:56] 497771 505372 508273 510859 ...
  ..$ X.1   : mtable [1:56(1d)] 0.871 0.969 0.964 1.144 1.293 ...
  .. ..- attr(*, dimnames)=List of 1
  .. .. ..$ X.1: chr [1:56] 4639803 4644255 4648384 4649389 ...
  ..$ X.2   : mtable [1:55(1d)] 2.29 2.41 2.23 2.13 2.51 ...
  .. ..- attr(*, dimnames)=List of 1
  .. .. ..$ X.2: chr 

[R] Simulating key-press or keyword events on a Mac

2012-09-05 Thread Reza Salimi-Khorshidi
Hello all,
Can someone please tell me how I can simulate a key press (particularly
arrow keys and space bar) on a Mac?
Any help is much appreciated.
Cheers

[[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] Comparing Von Bertalanffy Growth Curves

2012-09-05 Thread Jean V Adams
April Lindeman aprillinde...@yahoo.com wrote on 09/04/2012 01:43:06 PM:
 
 I am trying to compare Vbert growth curves from several years of 
 fish data. I am following the code provided by: http://
 www.ncfaculty.net/dogle/fishR/gnrlex/VonBertalanffy/VonBertalanffy.pdf
 . Specifically the section on VBGM Comparisons between groups. 
  
 This code is pretty cut and dry. I am able to run it perfectly with 
 the fake data that is provided. But when I run it with my own data
 I get stuck with this line: 
 fitGen - nls(vbGen,data=LMB,start=svGen)
  
 I get this error code: Error in numericDeriv(form[[3L]], names(ind),
 env) : Missing value or an infinity produced when evaluating the model.
 
  
 Does anyone know how to fix it? I have no missing values and do not 
 know how to fix the infinity produced. 
 
 Here is my data set: structure(list(Age = c(1L, 2L, 3L, 5L, 1L, 2L, 
 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 
 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L), MM = c(155.
 79, 296.37, 325.77, 374.65, 181.46, 258.31, 321.88, 355.6, 139.75, 
 230.72, 319.61, 344.84, 130.92, 236.34, 290.53, 360.33, 400.61, 155.
 33, 240.87, 315.46, 345.05, 378.2, 134.71, 256.66, 333.71, 362.99, 
 381.46, 153.91, 217.21, 287.8, 357.28, 385.62, 222.25, 288.93, 294.
 05, 332.79, 367.39), Year = c(2005L, 2005L, 2005L, 2005L, 2006L, 
 2006L, 2006L, 2006L, 2007L, 2007L, 2007L, 2007L, 2008L, 2008L, 
 2008L, 2008L, 2008L, 2009L, 2009L, 2009L, 2009L, 2009L, 2010L, 
 2010L, 2010L, 2010L, 2010L, 2011L, 2011L, 2011L, 2011L, 2011L, 
 2012L, 2012L, 2012L, 2012L, 2012L)), .Names = c(Age, MM, 
 Year), class = data.frame, row.names = c(NA, -37L)) 


As another person commented, you skipped the step where you attached the 
data
attach(LMB)


 In case it's helpful here is all my code before this point: 
 str(LMB) 


Why are you carrying out these as.integer() conversions?  It's not clear 
to me that they are necessary.


 MMi=as.integer(MM) 
 Yearf=as.factor(Year) 
 Agei=as.integer(Age) 


As another person commented, you skipped the step where you attached the 
needed packages.  I found I had to install and attach 7 packages to get 
your code to run!  But this could have been avoided by simply supplying us 
with the starting values:
svCom - list(Linf=430, K=0.5, t0=0)


 ( svCom - vbStarts(MMi~Agei,data=LMB)) 


You copied this code from the example in the pdf, but in that example they 
had only 2 groups.  You have 8 years.  So, this should be:
svGen - lapply(svCom, rep, length(unique(Year)))


 ( svGen - lapply(svCom,rep,2) ) 


Wow.  I didn't know you use the extraction function, [], in a formula. 
This is very good to know!  Thanks for educating me!!


 vbGen - MMi~Linf[Yearf]*(1-exp(-K[Yearf]*(Age-t0[Yearf]))+error) 
 fitGen - nls(vbGen,data=LMB,start=svGen) 
 
  
 Thank you, April


Here's the whole reproducible snippet of code ...

# the data
LMB - structure(list(Age = c(1L, 2L, 3L, 5L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 
4L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 
3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L), MM = c(155.79, 296.37, 325.77, 374.65, 
181.46, 258.31, 321.88, 355.6, 139.75, 230.72, 319.61, 344.84, 130.92, 
236.34, 290.53, 360.33, 400.61, 155.33, 240.87, 315.46, 345.05, 378.2, 
134.71, 256.66, 333.71, 362.99, 381.46, 153.91, 217.21, 287.8, 357.28, 
385.62, 222.25, 288.93, 294.05, 332.79, 367.39), Year = c(2005L, 2005L, 
2005L, 2005L, 2006L, 2006L, 2006L, 2006L, 2007L, 2007L, 2007L, 2007L, 
2008L, 2008L, 2008L, 2008L, 2008L, 2009L, 2009L, 2009L, 2009L, 2009L, 
2010L, 2010L, 2010L, 2010L, 2010L, 2011L, 2011L, 2011L, 2011L, 2011L, 
2012L, 2012L, 2012L, 2012L, 2012L)), .Names = c(Age, MM, Year), 
class = data.frame, row.names = c(NA, -37L)) 

# attach the data
attach(LMB)

# provide starting values
svCom - list(Linf=430, K=0.5, t0=0)
# repeat the starting values for each year
svGen - lapply(svCom, rep, length(unique(Year)))
# define a new variable, uniquely numbered for each year
Yearf - as.factor(Year)
# fit a single model with different parameter estimates for each year
fitGen - nls(MM ~ Linf[Yearf]*(1-exp(-K[Yearf]*(Age-t0[Yearf]))), 
data=LMB, start=svGen) 
fitGen

Jean
[[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] Recoding categorical gender variable into numeric factors

2012-09-05 Thread Conradsb
I currently have a data set in which gender is inputed as Male and Female
, and I'm trying to convert this into 1 and 0.

I found a website which reccomended using two commands:

data$scode[data$sex==M] - 1
data$scode[data$sex==F] - 2

to convert to numbers, and:

data$scode - factor(data$scode)

to convert this variable to a factor.



My issue is that, after I use the first command, *only* the female values
get converted to a number. I am left with a column filled with 2's and blank
spaces. Instead of typing both lines of the first command, I copy and pasted
the first line and changed the letter representing gender. I also made sure
that both letters were exactly as they appear in the dataset.

My questions are: is there any visible issue with my syntax, and are there
any other methods to accomplish this?

I'm also very new to R, so complex syntax is beyond me.

Conrad Baldner



--
View this message in context: 
http://r.789695.n4.nabble.com/Recoding-categorical-gender-variable-into-numeric-factors-tp4642316.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] POSIXlt and daylight savings time

2012-09-05 Thread Karl Ove Hufthammer
pdb wrote:

 as.POSIXlt('2004-10-31 02:00:00')
 [1] 2004-10-31
 as.POSIXlt('2004-10-31 03:00:00')
 [1] 2004-10-31 03:00:00
 
 How do I tell as.POSIXlt() to ignore daylight savings and just convert to
 a time as is? I've read about the 'isdst' but it is still unclear what to
 do.

There *was* no 02:00:00 in your local timezone, so you’re trying to specifiy 
a point in time that just didn’t exist. If you really want to do this, use 
the UTC timezone, by setting the ‘tz’ argument in as.POSIXct/as.POSIXlt to
UTC (or GMT).

-- 
Karl Ove Hufthammer
E-mail: k...@huftis.org
Jabber: huf...@jabber.no

__
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] Simulating key-press or keyword events on a Mac

2012-09-05 Thread Jeff Newmiller
This is very off-topic here.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  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.

Reza Salimi-Khorshidi worx.of.m...@gmail.com wrote:

Hello all,
Can someone please tell me how I can simulate a key press (particularly
arrow keys and space bar) on a Mac?
Any help is much appreciated.
Cheers

   [[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] Recoding categorical gender variable into numeric factors

2012-09-05 Thread Ista Zahn
Hi Conrad,

On Wed, Sep 5, 2012 at 3:14 PM, Conradsb csbal...@vt.edu wrote:
 I currently have a data set in which gender is inputed as Male and Female
 , and I'm trying to convert this into 1 and 0.

This is usually not necessary, and makes things more confusing. Male
and Female is clear and self-explanatory: 0 and 1 are not.

 I found a website which reccomended using two commands:

 data$scode[data$sex==M] - 1
 data$scode[data$sex==F] - 2

Nope, 1 is the character 1, not the number 1 in R. Also, you said
the values were Male and Female, not F and M. To convert
Male to 1 and Female to 2 you can use

data$scode[data$sex==Male] - 1
 data$scode[data$sex==Female] - 2

Notice Male and Female, instead of M and F, and 1 and 2
instead of 1 and 2



 to convert to numbers, and:

 data$scode - factor(data$scode)

 to convert this variable to a factor.

No need to convert it to a factor first. Just use

data$sex - factor(data$sex)




 My issue is that, after I use the first command, *only* the female values
 get converted to a number. I am left with a column filled with 2's and blank
 spaces.

Strange, especially if sex is actually Male and Female, in which
case scode should be all NA. If you want to follow up on this, please
post the result of

dput(dat[sex])

Instead of typing both lines of the first command, I copy and pasted
 the first line and changed the letter representing gender. I also made sure
 that both letters were exactly as they appear in the dataset.

 My questions are: is there any visible issue with my syntax, and are there
 any other methods to accomplish this?

In this case you don't actually need to convert to numeric. Just use

data$scode - factor(scode)

If you really need to convert characters to numbers, it is often
convenient to use factors as intermediate steps, like this:

dat - data.frame(sex=sample(c(Male, Female), 10, replace=TRUE))

dat$sex.n - as.numeric(
  as.character(
factor(
  dat$sex,
  levels = c(Female, Male),
  labels = c(0, 1

Best,
Ista

 I'm also very new to R, so complex syntax is beyond me.

 Conrad Baldner



 --
 View this message in context: 
 http://r.789695.n4.nabble.com/Recoding-categorical-gender-variable-into-numeric-factors-tp4642316.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] Recoding categorical gender variable into numeric factors

2012-09-05 Thread David L Carlson
I can't replicate your problem. I created a data set with Male and
Female since that is what you indicate, but your commands use M and F
which is different. When I use Male and Female the recoding is just as
expected, but you don't even need to do this. You probably already have a
factor since R routinely turns character fields into factors:

 data - data.frame(sex=c(rep(Male, 5), rep(Female, 5)))
 data
  sex
1Male
2Male
3Male
4Male
5Male
6  Female
7  Female
8  Female
9  Female
10 Female
 str(data)
'data.frame':   10 obs. of  1 variable:
 $ sex: Factor w/ 2 levels Female,Male: 2 2 2 2 2 1 1 1 1 1

So data$sex is a Factor with two levels Female=1 and Male=2. If the result
of str(data) looks like this, you have a character array (chr):

 str(data)
'data.frame':   10 obs. of  1 variable:
 $ sex: chr  Male Male Male Male ...

If you want to convert a character array to a factor just use the command:

data$sex - factor(data$sex)

By default, R orders the character strings alphabetically before converting
to factors so Female becomes 1 and Male becomes 2.

--
David L Carlson
Associate Professor of Anthropology
Texas AM University
College Station, TX 77843-4352

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org] On Behalf Of Conradsb
 Sent: Wednesday, September 05, 2012 2:14 PM
 To: r-help@r-project.org
 Subject: [R] Recoding categorical gender variable into numeric factors
 
 I currently have a data set in which gender is inputed as Male and
 Female
 , and I'm trying to convert this into 1 and 0.
 
 I found a website which reccomended using two commands:
 
 data$scode[data$sex==M] - 1
 data$scode[data$sex==F] - 2
 
 to convert to numbers, and:
 
 data$scode - factor(data$scode)
 
 to convert this variable to a factor.
 
 
 
 My issue is that, after I use the first command, *only* the female
 values
 get converted to a number. I am left with a column filled with 2's and
 blank
 spaces. Instead of typing both lines of the first command, I copy and
 pasted
 the first line and changed the letter representing gender. I also made
 sure
 that both letters were exactly as they appear in the dataset.
 
 My questions are: is there any visible issue with my syntax, and are
 there
 any other methods to accomplish this?
 
 I'm also very new to R, so complex syntax is beyond me.
 
 Conrad Baldner
 
 
 
 --
 View this message in context: http://r.789695.n4.nabble.com/Recoding-
 categorical-gender-variable-into-numeric-factors-tp4642316.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] help w/ uploading table frm R to green plump

2012-09-05 Thread ramoss
Hi,

Does anyone know how to upload a table to green plumb  have it be
distributed?

I know how to upload using sqlSave(chann, d, tablename=castaneg.wh_d,
rownames=F, colnames=T)
but how can I make my table be distributed randomly on the server.

In SAS you can use the option distribute_on=random


Thanks in advance  for your help



--
View this message in context: 
http://r.789695.n4.nabble.com/help-w-uploading-table-frm-R-to-green-plump-tp4642319.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] Outliers in Binary Logistic Regressions

2012-09-05 Thread Marcus Tullius
Hallo folks,

 I know I should not ask the same question again. But I have a problem I cannot 
solve and without the solution I am stuck and lost, unable to get along with my 
work!

 Someone suggested I should try the code below in order to eliminate the 
outliers from my data. I did as I was told, but I got a negative reply. The 
code did not function. I am including it here so that, if possible, someone may 
correct it for me. That would really be very much appreciated!

 My data has 1439 rows. 


 *RR.rebuild - glm(RR, subset=remove)
 glm(RR, subset=!(1:1439 %in% 
c(56,303,365,391,512,746,859,940,1037,1042,1138,1355))
 influence(RR.rebuild) 
 influence.measures(RR.rebuild)*

Many thanks in advance for any help and sorry for being annoyingly persistent!
 Francisco

[[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] showing ticks for censored data in survfit() in the rms package

2012-09-05 Thread Andrew Yee
The answer to this may be obvious, but I was wondering in the rms
package and the survfit(), how you can plot the censored time points
as ticks.

Take for example,

library(survival)
library(rms)

foo - data.frame(Time=c(1,2,3,4,5,6,10), Status=c(1,1,0,0,1,1,1))
answer - survfit(Surv(foo$Time, foo$Status==1) ~1)

# this shows the censored time points as ticks at Time = 3 and 4
plot(answer)

# how do you achieve something similar with survplot()
survplot(answer)

Thanks,
Andrew

__
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] using sqldf's read.csv.sql to read a file with NA for missing

2012-09-05 Thread David Reiner
I'm trying to use sqdf's function read.csv.sql to read CSV files in which the 
missing values are represented by NA's.
Plain old read.csv works fine on these files, but they are rather large and I'd 
like to filter using sql-like statements.
However, even if I specify field.types correctly and nrows=-1, it still turns 
the columns with NA's into chars or 0.
I'm trying to make this OS independent, so I don't think I can use a filter to 
convert the NA's to NULL's or whatever SQLite would understand.
I can accept it everything has to be read in as char and then convert to 
doubles with as.numeric, but I'm looking for speed.

Here is code I thought would read the file (I've attached a small sample.)
It almost works if there are no NA's in the initial rows, but it still turns 
NA's into 0's instead of NA or something I can change into NA;
and it returns characters if there are NA's in the initial rows.
(0 is a possible value so I can't filter out the 0's.)

field.types - list(V1='char', V2='char', V3='real', V4='int', V5='real', 
V6='int', V7='real')
dtst - read.csv.sql(./tmp.csv, header=FALSE, field.types=field.types, 
nrows=-1)
str(dtst)

'data.frame':   32 obs. of  7 variables:
 $ V1: chr  2012-07-01 2012-07-01 2012-07-01 2012-07-01 ...
 $ V2: chr  15:50:00 15:51:00 15:52:00 15:53:00 ...
 $ V3: chr  NA NA NA NA ...
 $ V4: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V5: chr  NA NA NA NA ...
 $ V6: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V7: chr  NA NA NA NA ...

Any suggestions?
Thanks,
-- David L. Reiner




This e-mail and any materials attached hereto, including, without limitation, 
all content hereof and thereof (collectively, XR Content) are confidential 
and proprietary to XR Trading, LLC (XR) and/or its affiliates, and are 
protected by intellectual property laws.  Without the prior written consent of 
XR, the XR Content may not (i) be disclosed to any third party or (ii) be 
reproduced or otherwise used by anyone other than current employees of XR or 
its affiliates, on behalf of XR or its affiliates.

THE XR CONTENT IS PROVIDED AS IS, WITHOUT REPRESENTATIONS OR WARRANTIES OF ANY 
KIND.  TO THE MAXIMUM EXTENT PERMISSIBLE UNDER APPLICABLE LAW, XR HEREBY 
DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS AND IMPLIED, RELATING TO THE XR 
CONTENT, AND NEITHER XR NOR ANY OF ITS AFFILIATES SHALL IN ANY EVENT BE LIABLE 
FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, INCLUDING, BUT NOT LIMITED TO, 
DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL AND PUNITIVE DAMAGES, LOSS OF PROFITS 
AND TRADING LOSSES, RESULTING FROM ANY PERSON'S USE OR RELIANCE UPON, OR 
INABILITY TO USE, ANY XR CONTENT, EVEN IF XR IS ADVISED OF THE POSSIBILITY OF 
SUCH DAMAGES OR IF SUCH DAMAGES WERE FORESEEABLE.
__
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] using sqldf's read.csv.sql to read a file with NA for missing

2012-09-05 Thread David Reiner
I see the attachment didn't go through.
here is the text:

2012-07-01,15:50:00,NA,0,NA,0,NA
2012-07-01,15:51:00,NA,0,NA,0,NA
2012-07-01,15:52:00,NA,0,NA,0,NA
2012-07-01,15:53:00,NA,0,NA,0,NA
2012-07-01,15:54:00,NA,0,NA,0,NA
2012-07-01,15:55:00,NA,0,NA,0,NA
2012-07-01,15:56:00,NA,0,NA,0,NA
2012-07-01,15:57:00,NA,0,NA,0,NA
2012-07-01,15:58:00,NA,0,NA,0,NA
2012-07-01,15:59:00,NA,0,NA,0,NA
2012-07-01,16:00:00,1358.5,1,1358.5,4,NA
2012-07-01,16:01:00,NA,0,1358.25,2,NA
2012-07-01,16:02:00,NA,0,1358.25,2,NA
2012-07-01,16:03:00,NA,0,1358.25,2,NA
2012-07-01,16:04:00,NA,0,1358.25,2,NA
2012-07-01,16:05:00,NA,0,1358.25,2,NA
2012-07-01,16:06:00,1358.25,2,1358.25,2,NA
2012-07-01,16:07:00,1358.25,2,1358.25,2,NA
2012-07-01,16:08:00,1358,3,1358,2,NA
2012-07-01,16:09:00,1358.25,2,1358.25,2,NA
2012-07-01,16:10:00,1358.25,2,1358.25,2,NA
2012-07-01,16:11:00,1358.25,2,1358.25,2,NA
2012-07-01,16:12:00,1357.5,3,1357.5,3,NA
2012-07-01,16:13:00,1357.25,10,1357.25,3,1357.25
2012-07-01,16:14:00,NA,0,1357.25,10,1357.125
2012-07-01,16:15:00,1357,20,1357,18,1357
2012-07-01,16:16:00,1357,20,1357,18,1357
2012-07-01,16:17:00,1357,20,1357,18,1357
2012-07-01,16:18:00,1357,20,1357,18,1357
2012-07-01,16:19:00,1357,20,1357,18,1357
2012-07-01,16:20:00,1357,20,1357,18,1357
2012-07-01,16:21:00,1357,20,1357,18,1357

-- David


-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of David Reiner
Sent: Wednesday, September 05, 2012 4:32 PM
To: r-help@r-project.org
Subject: [R] using sqldf's read.csv.sql to read a file with NA for missing

I'm trying to use sqdf's function read.csv.sql to read CSV files in which the 
missing values are represented by NA's.
Plain old read.csv works fine on these files, but they are rather large and I'd 
like to filter using sql-like statements.
However, even if I specify field.types correctly and nrows=-1, it still turns 
the columns with NA's into chars or 0.
I'm trying to make this OS independent, so I don't think I can use a filter to 
convert the NA's to NULL's or whatever SQLite would understand.
I can accept it everything has to be read in as char and then convert to 
doubles with as.numeric, but I'm looking for speed.

Here is code I thought would read the file (I've attached a small sample.)
It almost works if there are no NA's in the initial rows, but it still turns 
NA's into 0's instead of NA or something I can change into NA;
and it returns characters if there are NA's in the initial rows.
(0 is a possible value so I can't filter out the 0's.)

field.types - list(V1='char', V2='char', V3='real', V4='int', V5='real', 
V6='int', V7='real')
dtst - read.csv.sql(./tmp.csv, header=FALSE, field.types=field.types, 
nrows=-1)
str(dtst)

'data.frame':   32 obs. of  7 variables:
 $ V1: chr  2012-07-01 2012-07-01 2012-07-01 2012-07-01 ...
 $ V2: chr  15:50:00 15:51:00 15:52:00 15:53:00 ...
 $ V3: chr  NA NA NA NA ...
 $ V4: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V5: chr  NA NA NA NA ...
 $ V6: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V7: chr  NA NA NA NA ...

Any suggestions?
Thanks,
-- David L. Reiner




This e-mail and any materials attached hereto, including, without limitation, 
all content hereof and thereof (collectively, XR Content) are confidential 
and proprietary to XR Trading, LLC (XR) and/or its affiliates, and are 
protected by intellectual property laws.  Without the prior written consent of 
XR, the XR Content may not (i) be disclosed to any third party or (ii) be 
reproduced or otherwise used by anyone other than current employees of XR or 
its affiliates, on behalf of XR or its affiliates.

THE XR CONTENT IS PROVIDED AS IS, WITHOUT REPRESENTATIONS OR WARRANTIES OF ANY 
KIND.  TO THE MAXIMUM EXTENT PERMISSIBLE UNDER APPLICABLE LAW, XR HEREBY 
DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS AND IMPLIED, RELATING TO THE XR 
CONTENT, AND NEITHER XR NOR ANY OF ITS AFFILIATES SHALL IN ANY EVENT BE LIABLE 
FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, INCLUDING, BUT NOT LIMITED TO, 
DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL AND PUNITIVE DAMAGES, LOSS OF PROFITS 
AND TRADING LOSSES, RESULTING FROM ANY PERSON'S USE OR RELIANCE UPON, OR 
INABILITY TO USE, ANY XR CONTENT, EVEN IF XR IS ADVISED OF THE POSSIBILITY OF 
SUCH DAMAGES OR IF SUCH DAMAGES WERE FORESEEABLE.

__
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] using sqldf's read.csv.sql to read a file with NA for missing

2012-09-05 Thread Gabor Grothendieck
On Wed, Sep 5, 2012 at 5:31 PM, David Reiner david.rei...@xrtrading.com wrote:
 I'm trying to use sqdf's function read.csv.sql to read CSV files in which the 
 missing values are represented by NA's.
 Plain old read.csv works fine on these files, but they are rather large and 
 I'd like to filter using sql-like statements.
 However, even if I specify field.types correctly and nrows=-1, it still turns 
 the columns with NA's into chars or 0.
 I'm trying to make this OS independent, so I don't think I can use a filter 
 to convert the NA's to NULL's or whatever SQLite would understand.
 I can accept it everything has to be read in as char and then convert to 
 doubles with as.numeric, but I'm looking for speed.

 Here is code I thought would read the file (I've attached a small sample.)
 It almost works if there are no NA's in the initial rows, but it still turns 
 NA's into 0's instead of NA or something I can change into NA;
 and it returns characters if there are NA's in the initial rows.
 (0 is a possible value so I can't filter out the 0's.)

 field.types - list(V1='char', V2='char', V3='real', V4='int', V5='real', 
 V6='int', V7='real')
 dtst - read.csv.sql(./tmp.csv, header=FALSE, field.types=field.types, 
 nrows=-1)
 str(dtst)

 'data.frame':   32 obs. of  7 variables:
  $ V1: chr  2012-07-01 2012-07-01 2012-07-01 2012-07-01 ...
  $ V2: chr  15:50:00 15:51:00 15:52:00 15:53:00 ...
  $ V3: chr  NA NA NA NA ...
  $ V4: int  0 0 0 0 0 0 0 0 0 0 ...
  $ V5: chr  NA NA NA NA ...
  $ V6: int  0 0 0 0 0 0 0 0 0 0 ...
  $ V7: chr  NA NA NA NA ...


See FAQ#14 on the sqldf home page noting the part at the end of the
answer about csvfix.

-- 
Statistics  Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at 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] using sqldf's read.csv.sql to read a file with NA for missing

2012-09-05 Thread David L Carlson
You will probably have to contact the maintainer of package sqldf (G.
Grothendieck ggrothendi...@gmail.com) as it appears that the package does
not support missing values. I tried stripping out the NAs so that the fields
were empty, but the results are the same. Fields specified as numeric are
converted to character. Inserting a complete record at the top of the data
prevents the conversion to text, but NA's are still converted to zeros.

As a workaround, you could replace NA's with  before reading the file
and then convert this value to NA within R.

--
David L Carlson
Associate Professor of Anthropology
Texas AM University
College Station, TX 77843-4352


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org] On Behalf Of David Reiner
 Sent: Wednesday, September 05, 2012 4:40 PM
 To: r-help@r-project.org
 Subject: Re: [R] using sqldf's read.csv.sql to read a file with NA
 for missing
 
 I see the attachment didn't go through.
 here is the text:
 
 2012-07-01,15:50:00,NA,0,NA,0,NA
 2012-07-01,15:51:00,NA,0,NA,0,NA
 2012-07-01,15:52:00,NA,0,NA,0,NA
 2012-07-01,15:53:00,NA,0,NA,0,NA
 2012-07-01,15:54:00,NA,0,NA,0,NA
 2012-07-01,15:55:00,NA,0,NA,0,NA
 2012-07-01,15:56:00,NA,0,NA,0,NA
 2012-07-01,15:57:00,NA,0,NA,0,NA
 2012-07-01,15:58:00,NA,0,NA,0,NA
 2012-07-01,15:59:00,NA,0,NA,0,NA
 2012-07-01,16:00:00,1358.5,1,1358.5,4,NA
 2012-07-01,16:01:00,NA,0,1358.25,2,NA
 2012-07-01,16:02:00,NA,0,1358.25,2,NA
 2012-07-01,16:03:00,NA,0,1358.25,2,NA
 2012-07-01,16:04:00,NA,0,1358.25,2,NA
 2012-07-01,16:05:00,NA,0,1358.25,2,NA
 2012-07-01,16:06:00,1358.25,2,1358.25,2,NA
 2012-07-01,16:07:00,1358.25,2,1358.25,2,NA
 2012-07-01,16:08:00,1358,3,1358,2,NA
 2012-07-01,16:09:00,1358.25,2,1358.25,2,NA
 2012-07-01,16:10:00,1358.25,2,1358.25,2,NA
 2012-07-01,16:11:00,1358.25,2,1358.25,2,NA
 2012-07-01,16:12:00,1357.5,3,1357.5,3,NA
 2012-07-01,16:13:00,1357.25,10,1357.25,3,1357.25
 2012-07-01,16:14:00,NA,0,1357.25,10,1357.125
 2012-07-01,16:15:00,1357,20,1357,18,1357
 2012-07-01,16:16:00,1357,20,1357,18,1357
 2012-07-01,16:17:00,1357,20,1357,18,1357
 2012-07-01,16:18:00,1357,20,1357,18,1357
 2012-07-01,16:19:00,1357,20,1357,18,1357
 2012-07-01,16:20:00,1357,20,1357,18,1357
 2012-07-01,16:21:00,1357,20,1357,18,1357
 
 -- David
 
 
 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org] On Behalf Of David Reiner
 Sent: Wednesday, September 05, 2012 4:32 PM
 To: r-help@r-project.org
 Subject: [R] using sqldf's read.csv.sql to read a file with NA for
 missing
 
 I'm trying to use sqdf's function read.csv.sql to read CSV files in
 which the missing values are represented by NA's.
 Plain old read.csv works fine on these files, but they are rather large
 and I'd like to filter using sql-like statements.
 However, even if I specify field.types correctly and nrows=-1, it still
 turns the columns with NA's into chars or 0.
 I'm trying to make this OS independent, so I don't think I can use a
 filter to convert the NA's to NULL's or whatever SQLite would
 understand.
 I can accept it everything has to be read in as char and then convert
 to doubles with as.numeric, but I'm looking for speed.
 
 Here is code I thought would read the file (I've attached a small
 sample.)
 It almost works if there are no NA's in the initial rows, but it still
 turns NA's into 0's instead of NA or something I can change into NA;
 and it returns characters if there are NA's in the initial rows.
 (0 is a possible value so I can't filter out the 0's.)
 
 field.types - list(V1='char', V2='char', V3='real', V4='int',
 V5='real', V6='int', V7='real')
 dtst - read.csv.sql(./tmp.csv, header=FALSE,
 field.types=field.types, nrows=-1)
 str(dtst)
 
 'data.frame':   32 obs. of  7 variables:
  $ V1: chr  2012-07-01 2012-07-01 2012-07-01 2012-07-01 ...
  $ V2: chr  15:50:00 15:51:00 15:52:00 15:53:00 ...
  $ V3: chr  NA NA NA NA ...
  $ V4: int  0 0 0 0 0 0 0 0 0 0 ...
  $ V5: chr  NA NA NA NA ...
  $ V6: int  0 0 0 0 0 0 0 0 0 0 ...
  $ V7: chr  NA NA NA NA ...
 
 Any suggestions?
 Thanks,
 -- David L. Reiner
 
 
 
 
 This e-mail and any materials attached hereto, including, without
 limitation, all content hereof and thereof (collectively, XR Content)
 are confidential and proprietary to XR Trading, LLC (XR) and/or its
 affiliates, and are protected by intellectual property laws.  Without
 the prior written consent of XR, the XR Content may not (i) be
 disclosed to any third party or (ii) be reproduced or otherwise used by
 anyone other than current employees of XR or its affiliates, on behalf
 of XR or its affiliates.
 
 THE XR CONTENT IS PROVIDED AS IS, WITHOUT REPRESENTATIONS OR WARRANTIES
 OF ANY KIND.  TO THE MAXIMUM EXTENT PERMISSIBLE UNDER APPLICABLE LAW,
 XR HEREBY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS AND IMPLIED,
 RELATING TO THE XR CONTENT, AND NEITHER XR NOR ANY OF ITS AFFILIATES
 SHALL IN ANY EVENT BE LIABLE FOR 

Re: [R] showing ticks for censored data in survfit() in the rms package

2012-09-05 Thread David Winsemius

On Sep 5, 2012, at 2:05 PM, Andrew Yee wrote:

 The answer to this may be obvious, but I was wondering in the rms
 package and the survfit(), how you can plot the censored time points
 as ticks.

survfit() is not in rms.

 
 Take for example,
 
 library(survival)
 library(rms)
 
 foo - data.frame(Time=c(1,2,3,4,5,6,10), Status=c(1,1,0,0,1,1,1))
 answer - survfit(Surv(foo$Time, foo$Status==1) ~1)
 
 # this shows the censored time points as ticks at Time = 3 and 4
 plot(answer)
 
 # how do you achieve something similar with survplot()
 survplot(answer)
 

You should read more widely in the survival help pages. Since rms is in many 
cases built on top of the survival package. That 'answer'-object is of class 
survfit and there is a lines() method for survfit-objects. 

help(survfit)  # follow links to lines

lines(answer)  # ticks appear.

--

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] analysis of bitmaps

2012-09-05 Thread Scott Swigart
I'm interested in using R to perform some statistical analysis of bitmaps.  
When I search, I see a lot of information about outputting bitmaps, but I'm not 
finding much about loading a bitmap into a data frame so that it can be 
analyzed.  Would someone have a quick pointer to help me out?


[[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] Model Description

2012-09-05 Thread mahout user
Hello dear,


  I am new to R,  Have developed the model for prediction. I dont know
exactly about the followed terms
residual standard error
 degrees of freedom,
 multiple R-squared,
 adjusted R-squared
 F-statistics
 p-values

Thanks in advance.

[[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] Outliers in Binary Logistic Regressions

2012-09-05 Thread arun
Hi,
Not sure how your data looks like.  With the sample data below, the code works.

Try this:
set.seed(1)
dat1-data.frame(MIGRATION=sample(c(0,1),100,replace=TRUE),distance=sample(40:80,100,replace=TRUE))
RR.rebuild-glm(MIGRATION~distance,data=dat1,subset=!(1:100 %in% 
c(56,23,20,9,19)),family=binomial(link=logit))
 RR.rebuild

#Call:  glm(formula = MIGRATION ~ distance, family = binomial(link = logit), 
  #  data = dat1, subset = !(1:100 %in% c(56, 23, 20, 9, 19)))

#Coefficients:
#(Intercept) distance  
 #-0.0781611   -0.0004483  

#Degrees of Freedom: 94 Total (i.e. Null);  93 Residual
#Null Deviance:        131.4 
#Residual Deviance: 131.4     AIC: 135.4 
A.K.




- Original Message -
From: Marcus Tullius tull...@europe.com
To: r-help@r-project.org
Cc: 
Sent: Wednesday, September 5, 2012 3:42 PM
Subject: [R] Outliers in Binary Logistic Regressions

Hallo folks,

I know I should not ask the same question again. But I have a problem I cannot 
solve and without the solution I am stuck and lost, unable to get along with my 
work!

Someone suggested I should try the code below in order to eliminate the 
outliers from my data. I did as I was told, but I got a negative reply. The 
code did not function. I am including it here so that, if possible, someone may 
correct it for me. That would really be very much appreciated!

My data has 1439 rows. 


*RR.rebuild - glm(RR, subset=remove)
glm(RR, subset=!(1:1439 %in% 
c(56,303,365,391,512,746,859,940,1037,1042,1138,1355))
influence(RR.rebuild) 
influence.measures(RR.rebuild)*

Many thanks in advance for any help and sorry for being annoyingly persistent!
Francisco

    [[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] Maximum-likelihood fitting of a functional relationship(Ripley Thompson) type analysis

2012-09-05 Thread Turgut Durduran


Hello all,

Based on Ripley  Thompson, Analyst, 1987 , I am trying to do a regression of 
my data which assumes a linear relationship between measurements by two 
modalities of the same physiological parameter. The complication is that my 
errors are heterogeneous, i.e. not only both X  Y variables have significant 
variances, their ratio and individual values differ greatly between subjects. I 
believe a simple linear regression (which ignores the variances) is 
underestimating the slope of the relationship while a method like deming 
regression is overestimating (or underestimating depending on what I give as 
the ratio) since it assumes a constant ratio of the variable. Therefore, I have 
concluded that I need to do the full MLFR type of analysis suggested in that 
paper.

Looking through archives and such, I could not find a direct implementation for 
R. I think a related method is that implemeted in leiv package which 
implements errors-in-variables methods.

Admittedly, I am bit lazy and I did not dig into leiv implementation to 
figure out the differences and whether giving the ratio of the standard errors 
of Y to those of X for each point actually is correct.


I am wondering if anyone has implemented this method in R and has an example 
that I can look that. 


While at it,  I am wondering what is the way to estimate the 95% confidence 
interval in the results both for leiv and MLFR.


Thanks,

Turgut

__
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] Summarizing data containing data/time information (as factor)

2012-09-05 Thread HJ YAN
Dear R user

I want to create a table (as below) to summarize the attached data
(Test.csv, which can be read into R by using 'read.csv(Test.csv, header=F)'
), to indicate the day that there are any data available, e.g.value=1 if
there are any data available for that day, otherwise value=0.


  28/04 29/0430/0401/05   02/05
532703 0  1 1   10
532704 1  1 1   11
532705 0  0 1   10

Only Column A (Names: automatically stored as integer if being read into R)
and Column B (date/time: automatically stored as factor if being read into
R) are useful for this task.

Could anyone kindly provide me some hints/ideas about how to write some
code to to this job please?


Many thanks in advance!

Best wishes
HJ
__
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] Model Description

2012-09-05 Thread David Winsemius

On Sep 5, 2012, at 1:58 PM, mahout user wrote:

 Hello dear,
 
 
  I am new to R,  Have developed the model for prediction. I dont know
 exactly about the followed terms
 residual standard error
 degrees of freedom,
 multiple R-squared,
 adjusted R-squared
 F-statistics
 p-values
 
 Thanks in advance.
 

The r-help mailing list is not the place to go to correct your lack of 
knowledge about basic statistics. It is for questions about difficulties you 
have in constructing correct R code that persist after good faith efforts at 
self-education using the many contributed efforts at documentation. You may 
want to try instead: http://stats.stackexchange.com/

-- 

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] analysis of bitmaps

2012-09-05 Thread Michael Sumner
There are several packages to do this, with probably rgdal as the most
general for reading - it will read many image formats as a
SpatialGridDataFrame (class from package sp). This class behaves like
a data.frame in many ways and can be coerced to one with
as.data.frame. Non-spatial image formats will be provided with a
default set of coordinates.

You might also be interested in packages pixmap, raster, jpeg, png,
tiff and several others that can be found on CRAN to do with bitmap,
image or raster. It really depends on your needs and the form that
your data are in.

Cheers, Mike.

On Thu, Sep 6, 2012 at 7:09 AM, Scott Swigart sc...@cascadeinsights.com wrote:
 I'm interested in using R to perform some statistical analysis of bitmaps.  
 When I search, I see a lot of information about outputting bitmaps, but I'm 
 not finding much about loading a bitmap into a data frame so that it can be 
 analyzed.  Would someone have a quick pointer to help me out?


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



-- 
Michael Sumner
Hobart, Australia
e-mail: mdsum...@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] Summarizing data containing data/time information (as factor)

2012-09-05 Thread David Winsemius

On Sep 5, 2012, at 4:57 PM, HJ YAN wrote:

 Dear R user
 
 I want to create a table (as below) to summarize the attached data
 (Test.csv, which can be read into R by using 'read.csv(Test.csv, header=F)'
 ),

Unfortunately you did not read theinformation about posting attachments 
carefully enough and you csv filewas scrubbed by the mailserver.. I will 
attempt to recreate it:
 dat - read.table(text= 28/04 29/0430/0401/05   02/05
+ 532703 0  1 1   10
+ 532704 1  1 1   11
+ 532705 0  0 1   10, header=TRUE)
 sdat - stack(dat)
 sdat$id - rownames(dat)
 sdat2 - sdat[sdat$values0, c(3,2,1)]
 sdat2$ind - factor( sub(\\., /, sdat2$ind))
 sdat2$ind - factor( sub(X, , sdat2$ind))

At this point I think I have something similar to your original and will show 
how xtabs() can be used:

 xtabs(values ~id+ind, data=sdat2)
ind
id   01/05 02/05 28/04 29/04 30/04
  532703 1 0 0 1 1
  532704 1 1 1 1 1
  532705 1 0 0 0 1

The dates are not sorted the same but if you used Date formatted values, they 
might.

 sdat2$dt - as.Date( sdat2$ind, format=%d/%m)
 xtabs(values ~id+dt, data=sdat2)
dt
id   2012-04-28 2012-04-29 2012-04-30 2012-05-01 2012-05-02
  532703  0  1  1  1  0
  532704  1  1  1  1  1
  532705  0  0  1  1  0


 to indicate the day that there are any data available, e.g.value=1 if
 there are any data available for that day, otherwise value=0.
 
 
  28/04 29/0430/0401/05   02/05
 532703 0  1 1   10
 532704 1  1 1   11
 532705 0  0 1   10
 
 Only Column A (Names: automatically stored as integer if being read into R)
 and Column B (date/time: automatically stored as factor if being read into
 R) are useful for this task.
 
 Could anyone kindly provide me some hints/ideas about how to write some
 code to to this job please?
 
 
 Many thanks in advance!
 
 Best wishes
 HJ
 __
 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] merge a list of data frames

2012-09-05 Thread Sam Steingold
I have a list of data frames:

 str(data)
List of 4
 $ :'data.frame':   700773 obs. of  3 variables:
  ..$ V1: chr [1:700773] 200130446465779 200070050127778 200030633708779 
200010587002779 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 ...
 $ :'data.frame':   700773 obs. of  3 variables:
  ..$ V1: chr [1:700773] 200130446465779 200070050127778 200030633708779 
200010587002779 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 ...
 $ :'data.frame':   700773 obs. of  3 variables:
  ..$ V1: chr [1:700773] 200130446465779 200070050127778 200030633708779 
200010587002779 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 ...
 $ :'data.frame':   700773 obs. of  3 variables:
  ..$ V1: chr [1:700773] 200160325893778 200130647544079 200130446465779 
200120186959078 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 1 1 1 1 1 ...

I want to merge them.
I tried to follow
http://rwiki.sciviews.org/doku.php?id=tips%3adata-frames%3amerge
and did:

 data.1 - Reduce(function(f1,f2) merge(f1,f2,by=c(V1),all=TRUE), data)
Warning message:
In merge.data.frame(f1, f2, by = c(V1), all = TRUE) :
  column names 'V2.x', 'V3.x', 'V2.y', 'V3.y' are duplicated in the result
 str(data.1)
'data.frame':   700773 obs. of  9 variables:
 $ V1  : chr  10001099079 10001254078 10001499078 
10001541779 ...
 $ V2.x: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.x: num  0.476 0.748 0.442 0.483 0.577 ...
 $ V2.y: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.y: num  0.476 0.748 0.442 0.483 0.577 ...
 $ V2.x: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.x: num  0.476 0.752 0.443 0.485 0.578 ...
 $ V2.y: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.y: num  0.47 0.733 0.57 0.416 0.616 ...

I don't like the warning and I don't like that I now have to use [n] to
access identically named columns, but, I guess, this is better than
this:

library('reshape')

 data.1 - merge_all(data,by=V1,all=TRUE)
Error in merge.data.frame(dfs[[1]], Recall(dfs[-1]), all = TRUE, sort = FALSE,  
: 
  formal argument all matched by multiple actual arguments
 data.1 - merge_all(data,by=V1,sort=TRUE,all=TRUE)
Error in merge.data.frame(dfs[[1]], Recall(dfs[-1]), all = TRUE, sort = FALSE,  
: 
  formal argument all matched by multiple actual arguments
 data.1 - merge_all(data,by=V1,sort=TRUE)
Error in merge.data.frame(dfs[[1]], Recall(dfs[-1]), all = TRUE, sort = FALSE,  
: 
  formal argument sort matched by multiple actual arguments
 data.1 - merge_all(data,by=V1)
Error in `[.data.frame`(df, , match(names(dfs[[1]]), names(df))) : 
  undefined columns selected
 data.1 - merge_all(data,by=c(V1))
Error in `[.data.frame`(df, , match(names(dfs[[1]]), names(df))) : 
  undefined columns selected

what does 'formal argument sort matched by multiple actual arguments' mean?

thanks.

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://ffii.org http://pmw.org.il
http://dhimmi.com http://palestinefacts.org http://iris.org.il
I just forgot my whole philosophy of life!!!

__
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] merge a list of data frames

2012-09-05 Thread David Winsemius

On Sep 5, 2012, at 8:51 PM, Sam Steingold wrote:

 I have a list of data frames:
 
 str(data)
 List of 4
 $ :'data.frame':  700773 obs. of  3 variables:
  ..$ V1: chr [1:700773] 200130446465779 200070050127778 200030633708779 
 200010587002779 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 ...
 $ :'data.frame':  700773 obs. of  3 variables:
  ..$ V1: chr [1:700773] 200130446465779 200070050127778 200030633708779 
 200010587002779 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 ...
 $ :'data.frame':  700773 obs. of  3 variables:
  ..$ V1: chr [1:700773] 200130446465779 200070050127778 200030633708779 
 200010587002779 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 ...
 $ :'data.frame':  700773 obs. of  3 variables:
  ..$ V1: chr [1:700773] 200160325893778 200130647544079 200130446465779 
 200120186959078 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 1 1 1 1 1 ...
 
 I want to merge them.

Why? What are you expecting?

 I tried to follow
 http://rwiki.sciviews.org/doku.php?id=tips%3adata-frames%3amerge
 and did:
 
 data.1 - Reduce(function(f1,f2) merge(f1,f2,by=c(V1),all=TRUE), data)
 Warning message:
 In merge.data.frame(f1, f2, by = c(V1), all = TRUE) :
  column names 'V2.x', 'V3.x', 'V2.y', 'V3.y' are duplicated in the result
 str(data.1)
 'data.frame': 700773 obs. of  9 variables:
 $ V1  : chr  10001099079 10001254078 10001499078 
 10001541779 ...
 $ V2.x: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.x: num  0.476 0.748 0.442 0.483 0.577 ...
 $ V2.y: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.y: num  0.476 0.748 0.442 0.483 0.577 ...
 $ V2.x: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.x: num  0.476 0.752 0.443 0.485 0.578 ...
 $ V2.y: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.y: num  0.47 0.733 0.57 0.416 0.616 ...
 
 I don't like the warning and I don't like that I now have to use [n] to
 access identically named columns,

Perhaps it would make more sense to explain what your goal was, rather than 
showing us two divergent efforts, neither of which is satisfactory? Perhaps?

-- 
David.


 but, I guess, this is better than
 this:
 
 library('reshape')
 
 data.1 - merge_all(data,by=V1,all=TRUE)
 Error in merge.data.frame(dfs[[1]], Recall(dfs[-1]), all = TRUE, sort = 
 FALSE,  : 
  formal argument all matched by multiple actual arguments
 data.1 - merge_all(data,by=V1,sort=TRUE,all=TRUE)
 Error in merge.data.frame(dfs[[1]], Recall(dfs[-1]), all = TRUE, sort = 
 FALSE,  : 
  formal argument all matched by multiple actual arguments
 data.1 - merge_all(data,by=V1,sort=TRUE)
 Error in merge.data.frame(dfs[[1]], Recall(dfs[-1]), all = TRUE, sort = 
 FALSE,  : 
  formal argument sort matched by multiple actual arguments
 data.1 - merge_all(data,by=V1)
 Error in `[.data.frame`(df, , match(names(dfs[[1]]), names(df))) : 
  undefined columns selected
 data.1 - merge_all(data,by=c(V1))
 Error in `[.data.frame`(df, , match(names(dfs[[1]]), names(df))) : 
  undefined columns selected
 
 what does 'formal argument sort matched by multiple actual arguments' mean?
 
 thanks.
 
 -- 
 Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 
 11.0.11103000
 http://www.childpsy.net/ http://ffii.org http://pmw.org.il
 http://dhimmi.com http://palestinefacts.org http://iris.org.il
 I just forgot my whole philosophy of life!!!
 
 __
 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] Summarizing data containing data/time information (as factor)

2012-09-05 Thread arun
Hi,

I couldn't find any attached data.  Could you dput() the data?
A.K.



- Original Message -
From: HJ YAN yhj...@googlemail.com
To: r-help@r-project.org
Cc: 
Sent: Wednesday, September 5, 2012 7:57 PM
Subject: [R] Summarizing data containing data/time information (as factor)

Dear R user

I want to create a table (as below) to summarize the attached data
(Test.csv, which can be read into R by using 'read.csv(Test.csv, header=F)'
), to indicate the day that there are any data available, e.g.value=1 if
there are any data available for that day, otherwise value=0.


              28/04     29/04    30/04    01/05   02/05
532703     0              1         1           1        0
532704     1              1         1           1        1
532705     0              0         1           1        0

Only Column A (Names: automatically stored as integer if being read into R)
and Column B (date/time: automatically stored as factor if being read into
R) are useful for this task.

Could anyone kindly provide me some hints/ideas about how to write some
code to to this job please?


Many thanks in advance!

Best wishes
HJ

__
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] Maximum likelihood fitting of a functional relationship (MLFR)

2012-09-05 Thread Turgut Durduran


 

Hello all,

Evidently my previous message met some filter due to subject line. I am 
re-sending my message. I apologize if this was sent out twice.

Based on Ripley  Thompson, Analyst, 1987
 , I am trying to do a regression of my data which assumes a linear 
relationship between measurements by two modalities of the same 
physiological parameter. The complication is that my errors are 
heterogeneous, i.e. not only both X  Y variables have significant 
variances, their ratio and individual values differ greatly between 
subjects. I believe a simple linear regression (which ignores the 
variances) is underestimating the slope of the relationship while a 
method like deming regression is overestimating (or underestimating 
depending on what I give as the ratio) since it assumes a constant ratio
 of the variable. Therefore, I have concluded that I need to do the full
 MLFR type of analysis suggested in that paper.

Looking through 
archives and such, I could not find a direct implementation for R. I 
think a related method is that implemeted in leiv package which 
implements errors-in-variables methods.

Admittedly, I am bit lazy
 and I did not dig into leiv implementation to figure out the 
differences and whether giving the ratio of the standard errors of Y to 
those of X for each point actually is correct.


I am wondering if anyone has implemented this method in R and has an example 
that I can look that. 


While at it,  I am wondering what is the way to estimate the 95% confidence 
interval in the results both for leiv and MLFR.


Thanks,

Turgut

__
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 to extract p value from the lmekin object obtained by fitting mixed model with function lmekin() in package coxme?

2012-09-05 Thread Tian-Xiao Zhang
 Hi, R experts

  I am currently using lmekin() function in coxme package to fit a
mixed effect model for family based genetic data. How can I extract the p
value from a lmekin object?  When I print the object in R console, I can
see the p value and Z value are just over there. But I can not extract them
by the coef() function. kinfit$coefficient$fixed (kinfit is the name of the
lmekin object) just include the intercept and the value of fixed effects.
Where are p and Z values?

 Thank you!

-- 
Tianxiao Joshua Zhang, Ph.D. student
Human and Statistical Genetics Program
Division of Biology and Biomedical Sciences
Washington University in St. Louis

[[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] merge a list of data frames

2012-09-05 Thread Jeff Newmiller
I don't really know what you want, but if you have many columns with the same 
names I am wondering why this is so.  Do you really want to merge, which puts 
all of the non-key columns side-by-side in one data frame? If so, why don't you 
start by renaming the columns so they will make sense in the combined data 
frame?

If you really want the column names to stay the same, perhaps you want to stack 
the data frames vertically with rbind?
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  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.

Sam Steingold s...@gnu.org wrote:

I have a list of data frames:

 str(data)
List of 4
 $ :'data.frame':  700773 obs. of  3 variables:
..$ V1: chr [1:700773] 200130446465779 200070050127778
200030633708779 200010587002779 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 ...
 $ :'data.frame':  700773 obs. of  3 variables:
..$ V1: chr [1:700773] 200130446465779 200070050127778
200030633708779 200010587002779 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 ...
 $ :'data.frame':  700773 obs. of  3 variables:
..$ V1: chr [1:700773] 200130446465779 200070050127778
200030633708779 200010587002779 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 ...
 $ :'data.frame':  700773 obs. of  3 variables:
..$ V1: chr [1:700773] 200160325893778 200130647544079
200130446465779 200120186959078 ...
  ..$ V2: int [1:700773] 0 0 0 0 0 0 0 0 0 0 ...
  ..$ V3: num [1:700773] 1 1 1 1 1 1 1 1 1 1 ...

I want to merge them.
I tried to follow
http://rwiki.sciviews.org/doku.php?id=tips%3adata-frames%3amerge
and did:

 data.1 - Reduce(function(f1,f2) merge(f1,f2,by=c(V1),all=TRUE),
data)
Warning message:
In merge.data.frame(f1, f2, by = c(V1), all = TRUE) :
column names 'V2.x', 'V3.x', 'V2.y', 'V3.y' are duplicated in the
result
 str(data.1)
'data.frame':  700773 obs. of  9 variables:
$ V1  : chr  10001099079 10001254078 10001499078
10001541779 ...
 $ V2.x: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.x: num  0.476 0.748 0.442 0.483 0.577 ...
 $ V2.y: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.y: num  0.476 0.748 0.442 0.483 0.577 ...
 $ V2.x: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.x: num  0.476 0.752 0.443 0.485 0.578 ...
 $ V2.y: int  0 0 0 0 0 0 0 0 0 0 ...
 $ V3.y: num  0.47 0.733 0.57 0.416 0.616 ...

I don't like the warning and I don't like that I now have to use [n] to
access identically named columns, but, I guess, this is better than
this:

library('reshape')

 data.1 - merge_all(data,by=V1,all=TRUE)
Error in merge.data.frame(dfs[[1]], Recall(dfs[-1]), all = TRUE, sort =
FALSE,  : 
  formal argument all matched by multiple actual arguments
 data.1 - merge_all(data,by=V1,sort=TRUE,all=TRUE)
Error in merge.data.frame(dfs[[1]], Recall(dfs[-1]), all = TRUE, sort =
FALSE,  : 
  formal argument all matched by multiple actual arguments
 data.1 - merge_all(data,by=V1,sort=TRUE)
Error in merge.data.frame(dfs[[1]], Recall(dfs[-1]), all = TRUE, sort =
FALSE,  : 
  formal argument sort matched by multiple actual arguments
 data.1 - merge_all(data,by=V1)
Error in `[.data.frame`(df, , match(names(dfs[[1]]), names(df))) : 
  undefined columns selected
 data.1 - merge_all(data,by=c(V1))
Error in `[.data.frame`(df, , match(names(dfs[[1]]), names(df))) : 
  undefined columns selected

what does 'formal argument sort matched by multiple actual arguments'
mean?

thanks.

__
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 to extract p value from the lmekin object obtained by fitting mixed model with function lmekin() in package coxme?

2012-09-05 Thread Jeff Newmiller
Perhaps what you want to explore is the object returned from the summary method 
rather than the fit object?

coef(summary(kinfit))
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  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.

Tian-Xiao Zhang ztx...@gmail.com wrote:

 Hi, R experts

  I am currently using lmekin() function in coxme package to fit a
mixed effect model for family based genetic data. How can I extract the
p
value from a lmekin object?  When I print the object in R console, I
can
see the p value and Z value are just over there. But I can not extract
them
by the coef() function. kinfit$coefficient$fixed (kinfit is the name of
the
lmekin object) just include the intercept and the value of fixed
effects.
Where are p and Z values?

 Thank you!

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