[R] level names with groupdedData object

2007-09-05 Thread Dean Sonneborn
How do I get a grouped data object to use the level names from the input 
data set?
first I gave the levels some names like this:

male -factor(male)

levels(male) - c(“Girls”,”Boys”)

Then I created a groupdedData object but the male variable in not part 
of the grouping formula.

Then I fit an lme and then use this code to create a plot:
plot(myfit.lme, resid(. , type=”p”) ~ fitted(.) | male , id=0.05, adj=-0.3 )

But the plot just used “Male” in both panels. How do I get the plot to 
used Girls Boys?

Thanks,

Dean

__
R-help@stat.math.ethz.ch 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] plot log scale, axis original scale

2007-04-09 Thread Dean Sonneborn
I want to produce some boxplots and plot the logged values but have the 
axis scale in the original, not-logged scale. It seeming like I have the 
first few steps but I'm having trouble with the last. Here's what I'm 
doing (which I got for the documentation for boxplot and axis). How do I 
get the ticks to be labeled 2,5, and 9 of the original scale?
a-c(1,2,3,4,5,6,7,8,9,10)
bcat-c(1,1,1,2,2,2,2,3,3,3)
boxplot(log(a)~bcat, yaxt=n)
axis(2, tick=a)

-- 
Dean Sonneborn, MS
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(530) 754-9516 (voice)
(530) 752-3118 (fax)


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] subset by two variables

2006-08-29 Thread Dean Sonneborn
I'm using this syntax to create data subsets for plots:  
subset=source==Both. Now I would like to create a subset defined by 
two different variables like this: subset=source==Both  
subset=site==home but this syntax is not correct. The documents in the 
manual for subset seem to be creating whole new data files not just 
selecting rows based on the contents of the variables. How do I subset 
based on two variables.

-- 
Dean Sonneborn, MS
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(530) 754-9516


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] trellis in black and white

2006-08-08 Thread Dean Sonneborn

I am using this code but the output is not totally black and white. The 
dots and lines are green and the panel labels are light green or tan. I 
need to adapt this code to get just black on a wight background.

trellis.device(device=jpeg, file=C:/Documents and 
Settings/tables/figure2_March27b.jpg,theme=col.whitebg)

print( xyplot(AWGT ~ log(pcb_80) | malex*romanix, data=pcb_graph3a,

   auto.key = list(lines = TRUE, points = TRUE), ylab=Birth Weight, 
xlab=log PCB,

   type=c(p, smooth), span=.8) )

dev.off()
thanks

-- 
Dean Sonneborn, MS
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(530) 754-9516


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] boxplot

2006-05-17 Thread Dean Sonneborn
I am running this code to produce some boxplots. I have every thing that 
I need except that I would like the whisker line to be solid line, not 
dashes. I have reviewed the lattice docs but have not seemed to come 
across this point.

print( bwplot( group ~ lpcb_tot, data= data7,  xlab=Log PCB,
+   ylab=
+ G   B
+  S  M  S M  ) )

-- 
Dean Sonneborn, MS
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(530) 754-9516

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


[R] map question

2006-03-14 Thread Dean Sonneborn
Would anyone with experience with the map functions know how to divide 
Czechoslovakia into the Czech Republic and Slovakia. They have been two 
separate countries for some time now. I'm thinking about the worldhires 
map database  in particular.

-- 
Dean Sonneborn, MS
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(530) 754-9516

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


[R] jpeg or tiff file formats

2006-02-08 Thread Dean Sonneborn
I have been creating some graphic postscript files using xyplot but now 
I find that I need then in either the jpeg or tiff format.  I have tried 
re-running just the lattice plot so that it is on the screen and then 
using the jpeg(filename=myplot. from the bmp, jpec and png 
graphics devices documentation. It seems to create an empty file. Is it 
that this function can not work with lattice plots? Can R directly write 
a jpeg or pgn file?

-- 
Dean Sonneborn, MS
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(530) 754-9516

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


[R] footnote in postscript lattice

2006-01-26 Thread Dean Sonneborn
I would like to add a footnote to this graph but do not see a footnote 
command in the package:lattice documentation. I would like to note the span=.8
 as the footnote.

postscript(file= ”C:/Documents and Settings/dsonneborn/My 
Documents/Slovak/output/pcb_tables/smooth_PCB_lines_four.ps”, bg=”transparent”, 
onefile=FALSE, pointsize=20,paper=”letter”, horizontal=TRUE, 
family=”Helvetica”,font=”Helvetica”)

xyplot(AWGT ~ lipid_adj_lpcb2_cent | malex*romanix, data=pcb_graph3,

   auto.key = list(lines = TRUE, points = TRUE), ylab=”Birth Weight”, 
xlab=”Lipid Adjusted PCB”,

   par.settings =

   list(superpose.symbol = list(col = colr, pch = plotchar),

superpose.line = list(col = colr, pch = plotchar, lty = 1)),

type=c(p, smooth), span=.8)

dev.off()
thanks

-- 
Dean Sonneborn, MS
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(530) 754-9516

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


[R] multiple lowess line in one plot

2006-01-04 Thread Dean Sonneborn
I'm using this code to plot a smoothed line.  These two columns of data 
really represent 4 groups and I'd like to plot a separate line for each 
group but have them all in the same plot. The R-Docs for lowess do not 
seem to indicate some type of GROUPS=var_name option. What would be 
the syntax for this?

plot(AWGT ~ lipid )
lines(lowess(lipid , AWGT, f=.8))


-- 
Dean Sonneborn, MS
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(530) 754-9516

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


[R] gee models summary

2005-09-28 Thread Dean Sonneborn
I'm running some GEE models but when I request the summary(pcb.gee) all 
I get are rows and rows of intercorelations and they fill up the screen 
buffer so I can not even scroll back to see what else might be in the 
summary. How do I get the summary function to NOT print the 
intercorrelations?
Thanks,

-- 
Dean Sonneborn
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(916) 734-6656

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


[R] reading SAS data files

2005-09-26 Thread Dean Sonneborn
I am attempting to read in a SAS 9.1 data file. After starting R I 
change to the directory containing the sas data file and use the dir 
command to confirm that it is there. Then I run the following R-code:

library(foreign)

sashome - /Program Files/SAS/SAS 9.1

test-read.ssd(file.path(sashome), pcb,

 sascmd = file.path(sashome, sas.exe))


but R responds with:

SAS failed.  SAS program at 
C:\DOCUME~1\DSONNE~1\LOCALS~1\Temp\Rtmp3540\file16169.sas 
The log file will be file16169.log in the current directory
Warning message:
SAS return code was 2 in: read.ssd(file.path(sashome), pcb, sascmd = 
file.path(sashome, 

 
the SAS log file contain this:

NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. 
NOTE: SAS (r) 9.1 (TS1M3)
  Licensed to UNIV OF CA/DAVIS, Site 0029107010.
NOTE: This session is executing on the XP_PRO  platform.



NOTE: SAS initialization used:
  real time   0.13 seconds
  cpu time0.18 seconds
  
1  libname src2rd '/Program Files/SAS/SAS 9.1';
NOTE: Libref SRC2RD was successfully assigned as follows: 
  Engine:V9 
  Physical Name: C:\Program Files\SAS\SAS 9.1
2  libname rd xport 
'C:\DOCUME~1\DSONNE~1\LOCALS~1\Temp\Rtmp3540\file26090';
NOTE: Libref RD was successfully assigned as follows: 
  Engine:XPORT 
  Physical Name: C:\DOCUME~1\DSONNE~1\LOCALS~1\Temp\Rtmp3540\file26090
3  proc copy in=src2rd out=rd;
4  select pcb ;
ERROR: The file SRC2RD.PCB (memtype=ALL) was not found, but appears on a SELECT 
statement.
ERROR: The file SRC2RD.PCB (memtype=ALL) was not found, but appears on a SELECT 
statement.
ERROR: The file SRC2RD.PCB (memtype=ALL) was not found, but appears on a SELECT 
statement.
WARNING: Input library SRC2RD is empty.
NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE COPY used (Total process time):
  real time   0.00 seconds
  cpu time0.01 seconds
  

ERROR: Errors printed on page 1.
ERROR: Errors printed on page 1.
ERROR: Errors printed on page 1.

NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
  real time   0.16 seconds
  cpu time0.20 seconds
  
Does anyone see what I am doing incorrectly and can they offer any suggestions 
about getting this to run correctly?
 I'm not sure where SAS is expecting to find the data file. I have it in the 
default R directory. Is this where
SAS is looking for it or does it need to be somewhere else?

Thanks,


-- 
Dean Sonneborn
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(916) 734-6656


[[alternative HTML version deleted]]

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


[R] scatter plot

2005-08-11 Thread Dean Sonneborn
I'd like to do a simple scatter plot but instead of using the variable 
values on the X axis I would like to plot the percentiles. I searched in 
the manual for percentiles but did not find what I was looking for. I've 
been using SAS for several years but I new to R.

-- 
Dean Sonneborn
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(916) 734-6656

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


[R] scatter plot

2005-08-11 Thread Dean Sonneborn
I'm doing this scatter plot and it's almost what I want. What I would 
like to change is to have the X axis (the lipid_adj_pcb_cent variable) 
be plotted in percentiles not the variable values. Here's the code I 
currently using:

xyplot(zawgt_sk_cent ~ lipid_adj_pcb_cent, panel=function(x,y){

 panel.xyplot(x,y)

 panel.lmline(x,y)}, auto.key=TRUE, data=centered,  na.strings=, 
fontfamily = HersheySans , scales = list(  tick.number = 10))

 

 


-- 
Dean Sonneborn
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(916) 734-6656


[[alternative HTML version deleted]]

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


[R] 3 boxplots in one

2005-02-24 Thread Dean Sonneborn
I currently have 3 separate boxplots but would like to put them all in the 
graphic so they would have the same scale. Below are the three statements 
and as you can see the Y axis is weight:
bwplot(AWGT~  male2 
bwplot(AWGT ~ bin_pcb2 .
bwplot(AWGT ~ bin_pcb2 | male2 .

Does anyone have some sample code where they have done something like this?
Thanks,

Dean Sonneborn M.S.
Public Health Sciences *
University of California, Davis
916 734-6656

* formerly Epidemiology  Preventive Medicine

[[alternative HTML version deleted]]

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


[R] skip missing values in plots

2005-02-10 Thread Dean Sonneborn

 I really like these Trellis graphics but how do I get this code to 
skip the missing?

logreg-read.csv(logreg.csv, header=TRUE, sep=,, na.string= )
attach(logreg)

bwplot(yesno~bc_pcb_tot |varlist, data=logreg, main=Box Cox PCB 
transformation,  auto.key=TRUE, fontfamily = HersheySans )


Dean Sonneborn M.S.
Public Health Sciences *
University of California, Davis
916 734-6656

* formerly Epidemiology  Preventive Medicine

[[alternative HTML version deleted]]

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


[R] two issues

2005-02-03 Thread Dean Sonneborn
I'm working on a graphic but have run into a road block about two 
issues.  I don't have a color printer so I want to produce the graphic in 
black and white. I'm currently using this 
statement  trellis.device(bg=white)  but the body of the graphic contains 
color. What is the code to create the whole thing in black and white. The 
other issue might be a bit more tricky. I'm using this statement: 
auto.key=TRUE  and in the body of the graphic I'm getting two different 
symbols and on the screen I see two symbols in the key but when I print it 
the key only contains one symbol for both!

here's the whole R code statement:
dotplot(chemical~adjlogmle| convert*tdnew, data=allrisk , group=rodentx, 
main=Interspecies Conversion, pch=1:2, auto.key=TRUE, scales = 
list(tick.number=10), fontfamily = HersheySans)

Thanks,

Dean Sonneborn M.S.
Public Health Sciences *
University of California, Davis
916 734-6656

* formerly Epidemiology  Preventive Medicine

[[alternative HTML version deleted]]

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


[R] dotchart background color

2004-11-17 Thread Dean Sonneborn
I'm creating a dotchart but the background color is gray. In fact, when 
ever I use the Lattice package the background is gray, which prints as 
black on my non-color printer. How do I change the background color to 
white? I'm also plotting two groups and would like to use circles and 
triangles as the plot characters.

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


[R] x is not a open/high/low/close time series

2004-10-18 Thread Dean Sonneborn
I am trying to create a high low close style chart but I keep getting the 
following error statement; x is not a open/high/low/close time 
series.  I've used the function is.ts and R responds TRUE but the 
ohlcPlot  function gives the above error statement. I'm actually planning 
to plot some odds ratios with their confidence intervals and the 
hi-low-close chart should do the job if I can just figure out what the 
ohlcPlot  function is expecting the time series data to look like.
Thanks for the help
Dean Sonneborn

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


[R] graph question

2004-10-12 Thread Dean Sonneborn
I would like to produce a graph which plots a log scale variable on the 
y-axis but have the tick marks on the y-axis  be the non log transformed 
values that are round like .5, 1, 2, 3, 4 etc. Has anyone done something 
like this in the past? How did you implement it in the code?

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