Displaying 10 results from an estimated 10 matches for "hwt".
Did you mean:
hw
2013 Feb 28
3
Hidden information in an object
Hello, The dataset "cats" contain information about the heart weight ("Hwt"), body weight ("Bwt") and gender ("Sex") of a group of 144 cats. I write the following piece of code: library(MASS)attach(cats)ratio <- Hwt/Bwtmale <- ratio[Sex == "M"]female <- ratio[Sex == "F"] My question is, when I look at the object "...
2013 Feb 15
2
Making the plot window wider and using the predict function
Hello,
I am new to R and have a couple of questions. My data set contains the variables "Bwt" and "Hwt", which are bodyweight and heartweight, respectively, of a group of cats.
With the following code, I am making two plots, both to be viewed in the same plot window in R:
library(MASS)
maleData <- subset(cats, Sex == "M")
linreg0 <- lm(maleData$Hwt ~ maleData$Bwt)
par(mfrow=...
2009 Aug 04
0
Problems with lqs()
...t) year
-52.5 1.1
Scale estimates 2.129
You can do it over and over again and get the same coefficients. In contrast, if u use other data like cats from MASS or simulated data, u get different outputs every time u start the code if not electing a random.seed.
> lqs(Hwt~Bwt, data=cats, method="S")
Call:
lqs.formula(formula = Hwt ~ Bwt, data = cats, method = "S")
Coefficients:
(Intercept) Bwt
0.2625 3.6250
Scale estimates 1.474
> lqs(Hwt~Bwt, data=cats, method="S")
Call:
lqs.formula(formula = Hwt ~ Bwt,...
2008 Jan 07
1
xtable (PR#10553)
...Nielsen
Version: 2.5.0
OS: linux-gnu
Submission from: (NULL) (130.225.103.21)
The print-out of xtable in the following example is wrong; instead of yielding
the correct ci's for the second model it repeats the ci's from the first model.
require(xtable)
require(MASS)
data(cats)
b1<-lm(Hwt~Sex,cats)
b2<-lm(Hwt~Sex+Bwt,cats)
cbind(c(coef(b1),NA),rbind(confint(b1),c(NA,NA)),coef(b2),confint(b2))
xtable(cbind(c(coef(b1),NA),rbind(confint(b1),c(NA,NA)),coef(b2),confint(b2)))
1998 Jun 17
2
extra arguments to generic functions & bug in model.frame
R developers,
2 things: a bug in model.frame and a question about setup of generic
functions.
I don't understand the following behavior for generic functions:
Suppose I'm working with the cats data in the MASS library and I want to
create a formula object to model Hwt on Sex:
# This works:
> formula(Hwt ~ Sex)
Hwt ~ Sex
# But the following does not:
> formula(Hwt ~ Sex, data = cats)
Error in formula.formula(Hwt ~ Sex, cats) : unused argument to function
# because I used an extra argument.
The odd thing to me, is that formula() itself allows the argu...
2009 Feb 04
2
Sweave and \Sexpr{}
...data frame contains measurements of heart and body weight
of \SExpr{nrow(cats)} cats (\Sexpr{sum(cats$Sex=="F")} female,
\Sexpr{sum(cats$Sex=="M")} male).
A linear regression model of heart weight by sex and gender can be
fitted in R using the command
<<>>=
lm1 = lm(Hwt~Bwt*Sex, data=cats)
lm1
@
Tests for significance of the coefficients are shown in
Table~\ref{tab:coef}, a scatter plot including the regression lines is
shown in Figure~\ref{fig:cats}.
\SweaveOpts{echo=false}
<<results=tex>>=
xtable(lm1, caption="Linear regression model for cats...
2012 Apr 03
3
Sweave xtable
...data frame contains measurements of heart and body weight
of \Sexpr{nrow(cats)} cats (\Sexpr{sum(cats$Sex=="F")} female,
\Sexpr{sum(cats$Sex=="M")} male).
A linear regression model of heart weight by sex and gender can be
fitted in R using the command
<<>>=
lm1 = lm(Hwt~Bwt*Sex, data=cats)
lm1
@
Tests for significance of the coefficients are shown in
Table~\ref{tab:coef}, a scatter plot including the regression lines is
shown in Figure~\ref{fig:cats}.
\SweaveOpts{echo=false}
<<results=tex>>=
xtable(lm1, caption="Linear regression model for cats d...
2005 May 12
2
SVM linear kernel and SV
...at first with simple examples.
I use e1071 package and I have several questions. I'm working with data
extracted from cats data (from R). My dataset corresponds to a completely
separable case with a binary response variable ( Sex with 2 levels: F and
M), two explanatory variables (Bwt and Hwt) and the classes are balanced.
I've used svm() with a linear kernel and I'd like to plot the linear
hyperplane and the support vectors. I use plot.svm() and, according to me,
I would have found aligned support vectors (because the hyperplane is
linear) for each class but it wasn't...
2012 Jul 08
1
Grouped regression
...am a very occasional user of R, and will be grateful for some help in
constructing a regression across groups.
Here is an example:
library(MASS)
attach(cats)
Sex[120:144]<-factor(TG) #Renaming some males to transgender, to create 3
groups, male, female and transgender
out<-lm(Bwt~Sex/Hwt) #Gives me 3 separate linear regressions for groups M,
F and TG
What I now want to do is to examine subsets of this, where groups F and TG
have the same slope (and/or intercept). I want to do this in such a way
that future calls to anova() for model comparison will recognize the
subset str...
2010 Mar 31
2
Generative Topographic Map
I tried to use R version of package
I noticed the original MatLab Pckage is much better documented.
I had a look at the R demo code "gtm_demo" and found that variable Y is used in advanced of being created:
I wrote my own few lines as follows:
inDir <- "C:/Documents and Settings/Monville/Alanine Dipeptide/DBP1/DHA"
setwd(inDir)
T <-