[R] TSLS / 2SLS with a binary outcome

2014-11-30 Thread Philip Robinson
Hi,

I am wanting to complete 2 stage least squared regression with a binary
outcome. I have found and implemented a continuous outcome with tsls() from
the sen package or ivreg() from the AER package.

However I am struggling to find a package/function that implements a
function for  a binary outcome. If someone could knows of a package or
function and could help by pointing me in the right direction I would be
most grateful.

Kind regards
Philip

[[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] cex values being ignored in the curve function

2014-04-19 Thread Philip Robinson

Dear R-Community,

The cex values in curve seem to be being ignored. I have searched 
previous help questions and also the web generally, and cannot find this 
being a major problem so I am suspicious of something odd happening but 
I am at a loss to work out why.


I am trying to plot this:

b1  - -0.858
pow- 0.8
ratio   - 1
sig  - 0.05

curve((qnorm(1-sig/2)+qnorm(pow))^2/b1^2/x/(ratio/(1+ratio))/(1/(1+ratio)),from=0.005,to=0.08,main=This 
needs to be bigger,xlab=And this bigger too,ylab=And this too, 
cex=1,cex.lab=3.5, cex.axis=3.5, cex.main=3.5, cex.sub=3.5)


But no matter what value of cex I make it, or whether I break up the 
arguments into :


title(main=something,cex.main=3)
axis(cex.axis=2)

or parse this before plotting : par(cex.lab=1.5, cex.axis=1.5, 
cex.main=3.5, cex.sub=1.5)


I cannot get the main, axis titles or axis numbers to change in size, 
whatever I do.


I am using a macbook pro, with mavericks, R-studio and R 3.1.0 
spring-dance, and I am initiating the plot with:


X11( width=width , height=height , type=cairo).

Any help would be greatly appreciated.

thanks
Philip

__
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] ROCR package not installing

2012-11-22 Thread Philip Robinson
My version is:

Linux bioinform08 2.6.32-33-generic #70-Ubuntu SMP Thu Jul 7 21:13:52 UTC
2011 x86_64 GNU/Linux
Ubuntu 10.04.3 LTS

R version 2.10.1 (2009-12-14)

Philip

-Original Message-
From: Pascal Oettli [mailto:kri...@ymail.com] 
Sent: Thursday, 22 November 2012 4:20 PM
To: Philip Robinson
Cc: r-help@r-project.org
Subject: Re: [R] ROCR package not installing

Hello,

What is the version of R you use ?

Regards,
Pascal


Le 22/11/2012 15:02, Philip Robinson a écrit :
 I have tried installing the package (ROCR) with this command:



 Install.packages(ROCR)



 And with this command on the command line



 R CMD INSTALL ROCR_1.0-4.tar.gz



 But both times I get exactly the same error shown below, I don't 
 understand what is wrong, is this an error in the package code?



 Thank you

 Philip



 probinson@bioinform08:/tmp/RtmpO0rFbx/downloaded_packages$ R CMD 
 INSTALL ROCR_1.0-4.tar.gz

 * installing to library

 '/home/probinson/R/x86_64-pc-linux-gnu-library/2.10'

 * installing *source* package 'ROCR' ...

 ** R

 ** data

 ** demo

 ** preparing package for lazy loading

 Loading required package: gtools

 Loading required package: gdata

 gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED.



 gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED.



 Attaching package: 'gdata'





The following object(s) are masked from package:utils :



object.size



 Loading required package: caTools

 Loading required package: bitops

 Loading required package: grid

 Loading required package: KernSmooth

 KernSmooth 2.23 loaded

 Copyright M. P. Wand 1997-2009



 Attaching package: 'gplots'





The following object(s) are masked from package:stats :



lowess



 Error in setMethod(plot, signature(x = performance, y = missing),  :

no existing definition for function plot

 Error : unable to load R code in package 'ROCR'

 ERROR: lazy loading failed for package 'ROCR'

 * removing '/home/probinson/R/x86_64-pc-linux-gnu-library/2.10/ROCR'

 probinson@bioinform08:/tmp/RtmpO0rFbx/downloaded_packages$










   [[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] ROCR package not installing

2012-11-22 Thread Philip Robinson
Hi Mohammed,

This didn't work either:

Error in setMethod(plot, signature(x = performance, y = missing),  :
  no existing definition for function plot
Error : unable to load R code in package 'ROCR'
ERROR: lazy loading failed for package ‘ROCR’
* removing ‘/home/probinson/R/x86_64-pc-linux-gnu-library/2.10/ROCR’

The downloaded packages are in
‘/tmp/Rtmpn1DjHt/downloaded_packages’
Warning message:
In install.packages(ROCR, dep = T) :
  installation of package 'ROCR' had non-zero exit status

thanks
Philip

-Original Message-
From: Mohammed Ouassou [mailto:mohammed.ouas...@statkart.no] 
Sent: Thursday, 22 November 2012 6:02 PM
To: Philip Robinson
Cc: r-help@r-project.org
Subject: Re: [R] ROCR package not installing

try:
   install.packages(ROCR,dep=T)

M.O

On to., 2012-11-22 at 16:02 +1000, Philip Robinson wrote:
 I have tried installing the package (ROCR) with this command:
 
  
 
 Install.packages(ROCR)
 
  
 
 And with this command on the command line
 
  
 
 R CMD INSTALL ROCR_1.0-4.tar.gz
 
  
 
 But both times I get exactly the same error shown below, I don't 
 understand what is wrong, is this an error in the package code?
 
  
 
 Thank you
 
 Philip
 
  
 
 probinson@bioinform08:/tmp/RtmpO0rFbx/downloaded_packages$ R CMD 
 INSTALL ROCR_1.0-4.tar.gz
 
 * installing to library
 
 '/home/probinson/R/x86_64-pc-linux-gnu-library/2.10'
 
 * installing *source* package 'ROCR' ...
 
 ** R
 
 ** data
 
 ** demo
 
 ** preparing package for lazy loading
 
 Loading required package: gtools
 
 Loading required package: gdata
 
 gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED.
 
  
 
 gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED.
 
  
 
 Attaching package: 'gdata'
 
  
 
 
 
   The following object(s) are masked from package:utils :
 
  
 
   object.size
 
  
 
 Loading required package: caTools
 
 Loading required package: bitops
 
 Loading required package: grid
 
 Loading required package: KernSmooth
 
 KernSmooth 2.23 loaded
 
 Copyright M. P. Wand 1997-2009
 
  
 
 Attaching package: 'gplots'
 
  
 
 
 
   The following object(s) are masked from package:stats :
 
  
 
   lowess
 
  
 
 Error in setMethod(plot, signature(x = performance, y = missing),  : 
 
   no existing definition for function plot
 
 Error : unable to load R code in package 'ROCR'
 
 ERROR: lazy loading failed for package 'ROCR'
 
 * removing '/home/probinson/R/x86_64-pc-linux-gnu-library/2.10/ROCR'
 
 probinson@bioinform08:/tmp/RtmpO0rFbx/downloaded_packages$
 
  
 
 
 
 
 
 
 
 
   [[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] ROCR package not installing

2012-11-21 Thread Philip Robinson
I have tried installing the package (ROCR) with this command:

 

Install.packages(ROCR)

 

And with this command on the command line

 

R CMD INSTALL ROCR_1.0-4.tar.gz

 

But both times I get exactly the same error shown below, I don't understand
what is wrong, is this an error in the package code?

 

Thank you

Philip

 

probinson@bioinform08:/tmp/RtmpO0rFbx/downloaded_packages$ R CMD INSTALL
ROCR_1.0-4.tar.gz

* installing to library

'/home/probinson/R/x86_64-pc-linux-gnu-library/2.10'

* installing *source* package 'ROCR' ...

** R

** data

** demo

** preparing package for lazy loading

Loading required package: gtools

Loading required package: gdata

gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED.

 

gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED.

 

Attaching package: 'gdata'

 

 

  The following object(s) are masked from package:utils :

 

  object.size 

 

Loading required package: caTools

Loading required package: bitops

Loading required package: grid

Loading required package: KernSmooth

KernSmooth 2.23 loaded

Copyright M. P. Wand 1997-2009

 

Attaching package: 'gplots'

 

 

  The following object(s) are masked from package:stats :

 

  lowess 

 

Error in setMethod(plot, signature(x = performance, y = missing),  : 

  no existing definition for function plot

Error : unable to load R code in package 'ROCR'

ERROR: lazy loading failed for package 'ROCR'

* removing '/home/probinson/R/x86_64-pc-linux-gnu-library/2.10/ROCR'

probinson@bioinform08:/tmp/RtmpO0rFbx/downloaded_packages$ 

 

 

 

 


[[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] identifying a column name correctly to use in a formula

2012-02-29 Thread Philip Robinson
Hi,

I have a large matrix (SNPs) that I want to cycle over with logistic
regression with interaction terms. I have made a loop but I am struggling
to identify to the formula the name of the column in a way which is
meaningful to the formula. It errors becasue it is not evaluated proporly.

(below is a pilot with only 7 to 33 columns, my actual has 200,000 columns)

My attempts:


for (i in 7:33) {
  label - colnames(n)[i]
model1 - glm(AS~label*interaction,family=binomial(logit),data=n)
X - summary(model1)$coefficients[2,1]
Y - c(label,X)
vector - rbind(vector,Y)
} #variable lengths differ

Error in model.frame.default(formula = AS ~ label, data = n,
drop.unused.levels = TRUE) :
  variable lengths differ (found for 'label')

#This is because it is trying to do logistic regression on a character
string

for (i in 7:33) {
  label - eval(colnames(n)[i])
model1 - glm(AS~label*interaction,family=binomial(logit),data=n)
X - summary(model1)$coefficients[2,1]
Y - c(label,X)
vector - rbind(vector,Y)
} #variable lengths differ

Error in model.frame.default(formula = AS ~ label, data = n,
drop.unused.levels = TRUE) :
  variable lengths differ (found for 'label')

#same as above

for (i in 7:33) {
  label - as.name(colnames(n)[i])
model1 - glm(AS~label*interaction,family=binomial(logit),data=n)
X - summary(model1)$coefficients[2,1]
Y - c(label,X)
vector - rbind(vector,Y)
}

Error in model.frame.default(formula = AS ~ label, data = n,
drop.unused.levels = TRUE) :
  invalid type (symbol) for variable 'label
#not sure what this error is

for (i in 7:33) {
  label - eval(as.name(colnames(n)[i]))
model1 - glm(AS~label*interaction,family=binomial(logit),data=n)
X - summary(model1)$coefficients[2,1]
Y - c(label,X)
vector - rbind(vector,Y)
}

# Error in eval(expr, envir, enclos) : object 'B1' not found
B1 is the name of the first column - this isn't an object and that seems to
be why it is causing an error

for (i in 7:33) {
  label - as.formula(colnames(n)[i])
model1 - glm(AS~label*interaction,family=binomial(logit),data=n)
X - summary(model1)$coefficients[2,1]
Y - c(label,X)
vector - rbind(vector,Y)
}
Error in eval(expr, envir, enclos) : object 'B1' not found

#same as above

for (i in 7:33) {
  label - eval(as.formula(colnames(n)[i]))
model1 - glm(AS~label*interaction,family=binomial(logit),data=n)
X - summary(model1)$coefficients[2,1]
Y - c(label,X)
vector - rbind(vector,Y)
}

Error in eval(expr, envir, enclos) : object 'B1' not found
#same as above

Any help would be appreciated.

Thanks
Philip

[[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] nested if else statements

2012-02-05 Thread Philip Robinson
I have a vector of 2,1,0 I want to change to 0,1,2 respectively (the data
is allele dosages)

I have tried multiple nested if/else statements and looked at the ?if help
and cannot work out what is wrong, other people have posted code which is
identical and they state works.

Any help would be greatly appreciated.

 A[1:20]
[1] 1 1 0 0 1 0 1 0 1 0 0 0 1 1 0 1 1 1 0 0

 B - rep(NA,length(A))

 for (i in 1:length(A)){ if(A[i]==2){B[i] - 0} else
+ if(A[i]==0){B[i] - 2} else
+ if(A[i]==1){B[i] - 1}}

Error in if (A[i] == 2) { : missing value where TRUE/FALSE needed

[[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] extracting from data.frames for survival analysis

2012-01-26 Thread Philip Robinson
Hi,

I have a data frame:

 class(B27.vec)
[1] data.frame

 head(B27.vec)

  AGE Gend B27 AgeOn DD uveitis psoriasis IBD CD UC InI BASDAI BASFI Smok UV
1  571   119 38   2 1   1  1  1   1   5.40  8.08   NA  1
2  351   133  2   2 1   1  1  1   1   1.69  2.28   NA  1
3  492   140  9   1 1   1  1  1   1   8.30  9.40   NA  0
4  321   121 11   1 1   1  1  1   1   5.10  9.10   NA  0
5  311   124  7   1 1   1  1  1   1   6.63  6.52   NA  0
6  271   123  4   1 2   1  1  1   1   7.19  6.51   NA  0

I am trying to perform survival analysis but continually get errors
when extracting from this data.frame:

attempt 1:
 X - Surv(B27.vec$AgeOn,B27.vec$UV)
 survdiff(X,rho=0,data=uvf)
Error in x$terms : $ operator is invalid for atomic vectors

attempt 2:
 X - Surv(B27.vec[,4],B27.vec[,15])
 survdiff(X,rho=0,data=uvf)
Error in x$terms : $ operator is invalid for atomic vector

attempt 3:
 AO - B27.vec[[AgeOn, exact = TRUE]]
 UV - B27.vec[[UV,exact=TRUE]]
 X - Surv(AO,UV)
 survdiff(X,rho=0,data=uvf)
Error in x$terms : $ operator is invalid for atomic vectors

I have read ?data.frame  extract.data.frame but I cannot understand
how I might structure this differently so it extracts the required
columns from this dataframe. For the second 2 attempts I am not using
the $ term. Sorry if this seems basic but cannot understand why
attempt 1 or 2 doesn't work.

thanks
Philip

__
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] determining the difference between 2 character strings

2012-01-15 Thread Philip Robinson
Hi,

I am struggling, I have 2 lists with shared elements, one ~600, one
~1000, and I need to determine the difference between them.

They are character strings, and to use setdiff(), or unique() I need
vectors. I don't know how to force these character strings into a form
where you can use functions like setdiff(). Any help would be greatly
appreciated.


 head(R1)
[1] ccc-5-96078266-C-T ccc-5-96127578-C-T ccc-5-96133900-A-G
ccc-5-96145958-C-T ccc-5-96147966-C-T ccc-5-96150086-T-C

 head(R2)
[1] imm_5_96030100 imm_5_96377451 imm_5_96334858
imm_5_96318074 imm_5_96356643 imm_5_96389465

thanks
Philip

__
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] Lapack routine dgesv: system is exactly singular

2012-01-09 Thread Philip Robinson
Hi 

 

I have a problem with this error, I have searched the archives and found
previous discussion about this, can I cannot understand how the explanations
apply to what I am trying to do.

 

I am trying to do Log_rank Survival analysis, I have included tables and str
command, is it a factor/integer problem? If so how do I correct this, as all
my attempt to recode the data have failed.

 

 survdiff(Surv(f2$days.alive , f2$censored)~group, data=f2)

Error in drop(.Call(La_dgesv, a, as.matrix(b), tol, PACKAGE = base)) : 

  Lapack routine dgesv: system is exactly singular

 head(f2)

   group days.alive censored

1 PRI_CAS_5_NODU   18261

2 PRI_CAS_5_NODU   14880

3 PRI_CAS_5_NODU   18261

4 PRI_CAS_5_NODU   18261

5 PRI_CAS_5_NODU3030

6 PRI_CAS_5_NODU   18261

 str(f2)

'data.frame':   16795 obs. of  3 variables:

$ group : Factor w/ 2 levels PRI_CAS_5_NODU,..: 1 1 1 1 1 1 1 1 1 1
...

$ days.alive: int  1826 1488 1826 1826 303 1826 1826 971 467 1826 ...

$ censored  : int  1 0 1 1 0 1 1 0 0 1 ...

 table(f2$group)

 

PRI_CAS_5_NODU SEC_CAS_5_NODUP 

   3326   13469 

 

 table(f2$censored)

 

   01 

7860 8935


[[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] creating vectors from data-frames

2012-01-08 Thread Philip Robinson
 

I am having a problem with creating a vector from a rows or columns, I
searched around and found as.vector(x), but it does not seem to do what it
says it does

 

I have included an example below, of doing what would seem to be the method
required to create a vector, but instead it creates a one row data frame.
What is required to actually create a vector.

 

Many thanks

Philip

 

 data

  V1   V2   V3   V4   V5   V6V7V8V9   V10   V11

1  E 2369 2304 2312 2460 2645  3038  3265  3760  3904  4421

2 NZ  705  817  907  917  954 1,026 1,065 1,125 1,276 1,449

 

 nz -as.vector(data[2,2:11])

 

 nz

   V2  V3  V4  V5  V6V7V8V9   V10   V11

2 705 817 907 917 954 1,026 1,065 1,125 1,276 1,449

 

 class(nz)

 

[1] data.frame


[[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] R for loop stops after 4 iterations

2011-10-23 Thread Philip Robinson
That's fantastic, thank you very much, the qnorm option is interesting, I
will have to play around with it.

Many thanks again
Philip

-Original Message-
From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] 
Sent: Sunday, 23 October 2011 10:28 AM
To: Philip Robinson
Cc: r-help@r-project.org
Subject: Re: [R] R for loop stops after 4 iterations

There's a seeming inconsistency in this question -- namely,  you provide an
example of a data frame with 4 columns but say it is 27x3
-- but I think your question comes from a misunderstanding of what
length(e) calculates. For a data frame it gives the number of columns back.
Hence if you have a 27x4 data frame (which you appear to) iterations will
only fill the first four elements of output.

You'd probably rather use NROW(e). As an aside, for these sort of loops,
seq_along() is usually a very good choice, but it doesn't work here because
of the length() thing.

On another note, why don't you just do the calculation analytically and save
yourself some trouble?


# Something like
with(e, qnorm(0.42, V2, V3)*100)


Michael


On Sat, Oct 22, 2011 at 7:33 PM, Philip Robinson
philip.c.robin...@gmail.com wrote:
 I have a data frame called e, dim is 27,3, the first 5 lines look like
this:





     V1   V2   V3        V4

 1  1673 0.36 0.08  Smith

 2 167 0.36 0.08     Allen

 3    99 0.37 0.06     Allen

 4   116 0.38 0.07     Allen

 5    95 0.41 0.08     Allen



 I am trying to calculate the proportion/percentage of V1 which would 
 have values 0.42 if V2 was the mean of a normal distribution with V1 
 people and a standard distribution of V3. The loop works but only for 
 4 iterations then stops, I can't understand why, the code and the 
 output are below





 output - rep(NA, 27)

 for (i in 1:length(e))

 {

 x - rnorm(n=e[i,1], mean=e[i,2], sd=e[i,3])

 n - e[i,1]

 v - x0.42

 q -(sum(v)/n)*100

 output[i] - q

 }



output

 [1] 22.23551 27.54491 25.25253 19.82759       NA       NA       NA       
 NA NA

 [10]       NA       NA       NA       NA       NA       NA       NA       
 NA NA

 [19]       NA       NA       NA       NA       NA       NA       NA       
 NA NA


        [[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] R for loop stops after 4 iterations

2011-10-22 Thread Philip Robinson
I have a data frame called e, dim is 27,3, the first 5 lines look like this:

 

 

 V1   V2   V3V4

1  1673 0.36 0.08  Smith

2   167 0.36 0.08 Allen

399 0.37 0.06 Allen

4   116 0.38 0.07 Allen

595 0.41 0.08 Allen

 

I am trying to calculate the proportion/percentage of V1 which would have
values 0.42 if V2 was the mean of a normal distribution with V1 people and
a standard distribution of V3. The loop works but only for 4 iterations then
stops, I can't understand why, the code and the output are below

 

 

output - rep(NA, 27)

for (i in 1:length(e))

{

x - rnorm(n=e[i,1], mean=e[i,2], sd=e[i,3])

n - e[i,1]

v - x0.42

q -(sum(v)/n)*100

output[i] - q

}

 

output

[1] 22.23551 27.54491 25.25253 19.82759   NA   NA   NA   NA
NA

[10]   NA   NA   NA   NA   NA   NA   NA   NA
NA

[19]   NA   NA   NA   NA   NA   NA   NA   NA
NA


[[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] help with graphing -- Points in my graph are not apparent, always displayed in steps

2009-12-13 Thread philip robinson

http://n4.nabble.com/file/n962784/egraph_rules_list_2.png The red X's that
are listed above represent data points that have been completely ignored in
production of my graph. I know that in a specified sentence length there are
variations in number of Conjunctions
-- 
View this message in context: 
http://n4.nabble.com/help-with-graphing-Points-in-my-graph-are-not-apparent-always-displayed-in-steps-tp961629p962784.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] help with graphing -- Points in my graph are not apparent, always displayed in steps

2009-12-13 Thread philip robinson

Sorry to have not provided enough information in my prior post. Here is a
summary of the calculation set that I am doing. The histograms have changed
since my last post, but I am not so concerned about them. The scatter plots
do not show all of the points, they seem to round off to the most common. I
have tried doctoring the  http://n4.nabble.com/file/n963172/ESTATS ESTATS 
file to get a different result, but received no change.




removeOutliers-function(dataset){
return(
dataset[

max(sort(dataset$words)[1:(length(dataset$words)/100)])dataset$words  

dataset$words(min(sort(dataset$words)[(99*length(dataset$words)/100):length(dataset$words)])+1),,
]
)
};

edat.src-read.csv(ESTATS,head=TRUE,sep=\t);


edat-removeOutliers(edat.src);

# Only address the subset where there exists appropriate conjunctions within
the sentence
temp-edat[edat$R2SC0,,]

png(egraph_rules_list_2.png,width=800,height=700,res=72); 
par(mfrow=c(2,2));

#   graph that i am having trouble with, it does not seem to reflect the 
data
#   The scatter plots are not recognizing all of the data
qqplot(x=temp$words,y=temp$R2SC,ylab=With Rules applied SC,xlab=Number of
Words,col=blue,main=Subordinating Conjunctions\n(Number of Words));
hist(temp$words,col=heat.colors(max(temp$words)),main=Subortinating
Conjunctions \n-- Number of Words);
temp-edat[edat$R2CC0,,]
qqplot(x=temp$words,y=temp$R2CC,ylab=With  Rules applied CC,xlab=Number
of Words,col=purple,main=Coordinating Conjunctions\n(Number of Words));
hist(temp$words,col=heat.colors(max(temp$words)),main=Coordinating
Conjunctions \n-- Number of Words);
dev.off();




David Winsemius wrote:
 
 
 You provide no data. This is a guess, therefore. You have used a hist  
 call that has a ratio as the argument and were expecting it to be  
 interpreted as a formula.
 
 

-- 
View this message in context: 
http://n4.nabble.com/help-with-graphing-Points-in-my-graph-are-not-apparent-always-displayed-in-steps-tp961629p963172.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] help with graphing -- Points in my graph are not apparent, always displayed in steps

2009-12-13 Thread philip robinson

Thank you very much, 

 -- Philip



David Winsemius wrote:
 
 
 

-- 
View this message in context: 
http://n4.nabble.com/help-with-graphing-Points-in-my-graph-are-not-apparent-always-displayed-in-steps-tp961629p963227.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 with graphing -- Points in my graph are not apparent, always displayed in steps

2009-12-11 Thread philip robinson

I am trying to graphically represent a large set of data who's result is not
strictly uniform.  http://n4.nabble.com/file/n961629/egraph_rules_list_2.png 
The scatter plot to the left has all of the data rising in steps however I
know that there are cases within my data that do not fit the dotted line.


temp-edat[edat$R1SC0,,]
png(egraph_rules_list_1.png,width=800,height=700,res=72);
par(mfrow=c(2,2));
qqplot(x=temp$words,y=temp$R1SC,ylab=With Rules applied SC
Shortlist,xlab=Number of Words,col=blue,main=Subordinating
Conjunctions\n(Number of Words),type=p);
hist(temp$R1SC/temp$words,col=heat.colors(max(temp$R1SC)),main=Subortinating
Conjunctions \n/ Number of Words);
temp-edat[edat$R1CC0,,]
qqplot(x=temp$words,y=temp$R1CC,ylab=With Rules applied CC
Shortlist,xlab=Number of Words,col=purple,main=Coordinating
Conjunctions\n(Number of Words),type=p);
hist(temp$R1CC/temp$words,col=heat.colors(max(temp$R1CC)),main=Coordinating
Conjunctions \n/ Number of Words);
dev.off();



your help is much appreciated
-- 
View this message in context: 
http://n4.nabble.com/help-with-graphing-Points-in-my-graph-are-not-apparent-always-displayed-in-steps-tp961629p961629.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.