Displaying 3 results from an estimated 3 matches for "skin_color".
2013 Jan 08
4
error in a abline loop
...pe="p",
pch=1,lwd=1.0,
cex.lab=1.4, cex.axis=1.2,
font.axis=2,
cex=1.5,
las=1,
bty="l",col=c("yellow","chocolate1","darkorange2",
"red3","saddlebrown","coral4","grey38")[as.numeric(data$skin_color)])
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##
for (i in 1:7) {
subs <- data$skin_color==levels(data$skin_color)[i]
line<-lm(body_weight~body_length, data=subset(data, subset=subs),
abline(line,col=c(&qu...
2013 Jan 12
1
add categorical labels in plot
Hello
I want to draw a plot using the code below.
Further, I want to add labels (White, Yellow, Red) to x-axis.
Please kindly advise how to add the categorical labels, by modifying the
code.
Thank you.
Elaine
Code
dataN <-read.csv("H:/skin_color.csv",header=T, row.names=1)
dim(dataN)
dataN[1,]
str(dataN)
obs.group<-dataN$skin_color
levels(dataN$skin_color) <- skin.code
skin.code <- c("White", "Yellow", "Red")
# graph
par(mai=c(1.03,1.03,0.4,0.4))
p...
2013 Jan 08
2
plot residuals per factor
Dear R-users,
I want to plot residuals vs fitted for multiple groups with ggplot2.
I try this code, but unsuccessful.
library("plyr")
models<-dlply(dat1,"d",function(df)
mod<-lm(y~x,data=df)
ggplot(models,aes(.fitted,.resid), color=factor(d))+
geom_hline(yintercept=0,col="white",size=2)+
geom_point()+
geom_smooth(se=F)
--
---
Catalin-Constantin ROIBU