Displaying 20 results from an estimated 400 matches similar to: "Missing shapes in legend with scale_shape_manual"
2023 Oct 31
0
Missing shapes in legend with scale_shape_manual
I believe the missing shapes are because you had set alpha=0 for the last geom point.
I expect there are better ways, but one way to handle it would be to avoid the filtering, adding columns with med and exercise status, like the following:
# setup with data provided
Date <- c('2023-10-17', '2023-10-16', '2023-10-15', '2023-10-14',
2023 Oct 30
1
Missing shapes in legend with scale_shape_manual
Hello,
I'm trying to plot a graph of blood glucose versus date. I also record
conditions, such as missing the previous night's medications, and
missing exercise on the previous day. My data looks like:
> b2[68:74,]
# A tibble: 7 ? 5
Date Time bg missed_meds no_exercise
<date> <time> <dbl> <lgl> <lgl>
1 2023-10-17 08:50
2012 Apr 16
1
ggplot2: scale_shape_manual
Hi,
I was trying to replicate one of the graphs given on the ggplot2 website. I
have given a sample code below. I would like to combine the legends, since
each color is uniquely mapped to a shape.
###
library(ggplot2)
leaves <- letters[1:8]
mat <- matrix(sample(1:1000,32),nrow=16,ncol=2)
colnames(mat) <- paste('t',1:2,sep='')
df <-
2010 Jan 03
2
plot question
Hi,
I am new to R so forgive me if the following query is somewhat simple. I have a small tab-separated file with n records of glucose values, one record per day, seven measurements per day. It looks like this:
date sober no vm nm va na vs
20091229 NA 6.8 NA 2.7 11.7 2.7 6.2
I'd like to make a graph on which the glucose day curves are plotted
2018 Apr 25
0
Zero errors : Bug in my R code ?
Dear R-experts,
I guess I have a problem with my fast function (fast tau estimator) here below. Indeed, zero errors look highly suspicious. I guess there is a bug in my R code. How could I correct my R code ?
# install.packages( "robustbase" )
# install.packages( "MASS" )
# install.packages( "quantreg" )
# install.packages( "RobPer" )
#
2013 Jan 07
3
renumber a list of numbers
Greetings R users,
I am trying to renumber my groups within the file shown below. The groups
are currently set as 8,9,10,etc. I would like to renumber this as
1,2,3,etc. I have searched the help files and only come across using the
rownames to renumber the values but I need to match values. Any assistance
is always appreciated,
Regards,
Charles
structure(list(Group = structure(c(1L, 1L, 1L,
2003 Sep 26
3
Std. errors of intercept and slope
Dear all,
I have the following output generated by linear regression. Since there is
only one regression intercept and one slope for one set of data, what is the
meaning of std. error for intercept and that of slope? Thanks in advance.
Sincerely,
Minghua
> data(thuesen)
> attach(thuesen)
> lm(short.velocity~blood.glucose)
Call:
lm(formula = short.velocity ~ blood.glucose)
2007 Nov 14
2
Help with Bartlett's test on linear model
Hi all,
I would like to test the homoegeneity of variances between several
linear model for some analysis of covariance. It seems that the
Bartlett's test is a good test to use but I am having problem using with
linear model and I cannot find any examples on the internet. There are
some examples for comparisons of variances but not linear models.
If I take the hellung data set, which is
2018 May 22
0
Bootstrap and average median squared error
Hello,
If you want to bootstrap a statistic, I suggest you use base package boot.
You would need the data in a data.frame, see how you could do it.
library(boot)
bootMedianSE <- function(data, indices){
d <- data[indices, ]
fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d)
ypred <- predict(fit)
y <- d$crp
median(y - ypred)^2
}
dat <-
2018 May 22
2
Bootstrap and average median squared error
I forgot, you should also set.seed() before calling boot() to make the
results reproducible.
Rui Barradas
On 5/22/2018 10:00 AM, Rui Barradas wrote:
> Hello,
>
> If you want to bootstrap a statistic, I suggest you use base package boot.
> You would need the data in a data.frame, see how you could do it.
>
>
> library(boot)
>
> bootMedianSE <- function(data,
2009 Oct 27
1
"ipredknn" - How may I find values?
Hi everybody!
I want to find a closer neighbourins observation. This is my code:
##########################
library(klaR)
library(ipred)
library(mlbench)
data(PimaIndiansDiabetes2)
dane=na.omit(PimaIndiansDiabetes2)[,c(2,5,9)]
dane[,2]=log(dane[,2])
dane[,1:2]=scale(dane[,1:2])
zbior.uczacy=sample(1:nrow(dane),nrow(dane)/2,F)
2009 Aug 17
1
Multiple comparison on lme model with 2 fixed factors
Hi!
I'm a bit lost while performing multiple comparisons on a lme model of that
type:
lmeglu=lme(glucose~Ath*tim,random=~1|Vol,na.action=na.omit,data=data)
multc = glht(lmeglu, linfct = mcp(Ath = "Tukey", tim = "Tukey"))
This works fine for identifying the effect of each factor. However, when I
look for their interactions, l only obtain error messages.
For example this
2007 Oct 19
2
In a SLR, Why Does the Hat Matrix Depend on the Weights?
I understand that the hat matrix is a function of the predictor variable
alone. So, in the following example why do the values on the diagonal of the
hat matrix change when I go from an unweighted fit to a weighted fit? Is the
function hatvalues giving me something other than what I think it is?
library(ISwR)
data(thuesen)
attach(thuesen)
fit <- lm(short.velocity ~ blood.glucose)
2009 May 12
1
questions on rpart (tree changes when rearrange the order of covariates?!)
Greetings,
I am using rpart for classification with "class" method. The test data is
the Indian diabetes data from package mlbench.
I fitted a classification tree firstly using the original data, and then
exchanged the order of Body mass and Plasma glucose which are the
strongest/important variables in the growing phase. The second tree is a
little different from the first one. The
2018 May 21
2
Bootstrap and average median squared error
Dear R-experts,
I am trying to bootstrap (and average) the median squared error evaluation metric for a robust regression. I can't get it. What is going wrong ?
Here is the reproducible example.
#############################
install.packages( "quantreg" )
library(quantreg)
crp <-c(12,14,13,24,25,34,45,56,25,34,47,44,35,24,53,44,55,46,36,67)
bmi
2007 Nov 22
3
anova planned comparisons/contrasts
Hi,
I'm trying to figure out how anova works in R by translating the
examples in Sokal And Rohlf's (1995 3rd edition) Biometry. I've hit a
snag with planned comparisons, their box 9.4 and section 9.6. It's a
basic anova design:
treatment <- factor(rep(c("control", "glucose", "fructose",
"gluc+fruct",
2010 Mar 09
1
create picture (k -the nearest neighbours)
Hi
I want to create a nice picture about my result of k -the nearest neighbours
algorithm. Here is my easy code:
#################################
library(klaR)
library(ipred)
library(mlbench)
data(PimaIndiansDiabetes2)
dane=na.omit(PimaIndiansDiabetes2)[,c(2,5,9)]
dane[,2]=log(dane[,2])
dane[,1:2]=scale(dane[,1:2])
zbior.uczacy=sample(1:nrow(dane),nrow(dane)/2,F)
2018 May 22
1
Bootstrap and average median squared error
Hello,
Right!
I copied from the OP's question without thinking about it.
Corrected would be
bootMedianSE <- function(data, indices){
d <- data[indices, ]
fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d)
ypred <- predict(fit)
y <- d$crp
median((y - ypred)^2)
}
Sorry,
rui Barradas
On 5/22/2018 11:32 AM, Daniel Nordlund wrote:
> On 5/22/2018
2009 Mar 05
1
ANOVA
Hi All,
I have about one hundred patients and all the patients had their glucose
measured on three different days. The days are all the same for all he
patients. So I have three measurement for each patient . I want to know
whether the day when the glucose was measured has an effect on the
measurements. I was thinking to use a single factor analysis of variance but
I am not sure how to do it in
2010 May 13
1
What's data() for?
Hi there,
>library(faraway)
>pima
pregnant glucose diastolic triceps insulin bmi diabetes age test
1 6 148 72 35 0 33.6 0.627 50 1
2 1 85 66 29 0 26.6 0.351 31 0
>data(pima)
>pima
pregnant glucose diastolic triceps insulin bmi diabetes age test
1 6 148 72 35 0 33.6