search for: bwt

Displaying 20 results from an estimated 38 matches for "bwt".

Did you mean: but
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 ~ maleD...
2010 Feb 12
1
validate (rms package) using step instead of fastbw
...l. I'd like to use step instead of fastbw. I think this can be done by hacking predab.resample in a couple of places but I am wondering if this is a bad idea (why?) or if I am reinventing the wheel. Best, R. P.S. Simple example of fastbw compared to step: library(MASS) ## for stepAIC and bwt data example(birthwt) library(rms) bwt.glm <- glm(low ~ ., family = binomial, data = bwt) bwt.lrm <- lrm(low ~ ., data = bwt) step(bwt.glm) ## same as stepAIC(bwt.glm) fastbw(bwt.lrm) -- Ramon Diaz-Uriarte Structural Biology and Biocomputing Programme Spanish National Cancer Centre (CN...
2010 Sep 07
1
how to combine several subsets?
I simply put, > NEVER=subset(infants$bwt,ISNO1) > UNTILPREGNANT=subset(infants$bwt, ISNO2) > ONCENOTNOW=subset(infants$bwt, ISNO3) and I wanna combine those three. I do it like ISNO=NEVER&UNTILPREGNANT&ONCENOTNOW and R tells me 1: In NEVER & UNTILPREGNANT : longer object length is not a multiple of shorter object...
2008 Dec 19
0
"parm" argument in confint.multinom () nnet package
...ccepts the "parm" argument, it doesn't appear to offer this functionality if there are more than two response categories. Since this method isn't documented, maybe I shouldn't expect it to, but there seems to be a simple solution. Compare: library(MASS) example(birthwt) (bwt.mu <- multinom(low ~ ., bwt)) confint(bwt.mu,"age") with (bwt.mu2 <- multinom(race ~ ., bwt)) confint(bwt.mu2,"age") It looks like John Fox has something going on R-Forge regarding another version of the confint.multinom() function (http://r-forge.r-project.org/pl...
2009 Aug 04
0
Problems with lqs()
...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, dat...
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 "ratio", it is just a list...
2010 Oct 12
1
Help with function writing
...mple: #define function involving regression model with several covariates custom <- function(outcome, exposure, covar1, covar2, covar3){ model <- lm(outcome ~ exposure + covar1 + covar2 + covar3) expected <- predict(model) summary(expected) } library(MASS) attach(birthwt) custom(bwt, lwt, low, age, race) #Works when 3 covariates are specified custom(bwt,lwt,low,age) # Does not work with < or > 3 covariates varlist <- list(low,age,race) custom(bwt,lwt, varlist) #Does not work if covariates are included as a list Thanks very much for your help Tim -- Tim Elwell-S...
2007 Jul 05
17
ZFS Compression algorithms - Project Proposal
...preciate any suggestion or comments. PROJECT PROPOSAL: ZFS Compression Algorithms. The main purpose of this project is the development of new compression schemes for the ZFS file system. We plan to start with the development of a fast implementation of a Burrows Wheeler Transform based algorithm (BWT). BWT is an outstanding tool and the currently known lossless compression algorithms based on it outperform the compression ratio of algorithms derived from the well known Ziv-Lempel algorithm, while being a little more time and space expensive. Therefore, there is space for improvement: recent res...
2018 May 30
1
CRAN checks give errors when no tests are included
...ut: Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(testthat) Warning message: package 'testthat' was built under R version 3.3.3 > library(bwt) > > test_check("bwt") Error: No tests found for bwt Execution halted * DONE I checked the package and it had no tests subfolder. Yet -as far as I can judge- CRAN tried to run tests anyway and error'd when there were none to be found. This would make sense of adding tes...
2003 May 03
1
expand.grid
...gt; Levels: a b # reference level is a Thank you very much for the ready explanations and comments. I found this inconsistency working with contingency tables and logistic models. I was working with a flat contingency table as for example, > ft <- ftable(low ~ race + smoke, bwt) > ft low 0 1 race smoke white FALSE 40 4 TRUE 33 19 black FALSE 11 5 TRUE 4 6 other FALSE 35 20 TRUE 7 5 (here bwt is a transformation of the dataframe birthwt in library(MASS)). I wanted to analyse this table by a logistic mo...
2009 Feb 04
2
Sweave and \Sexpr{}
...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 dat...
2012 Apr 03
3
Sweave xtable
...a 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 data....
2002 Feb 22
1
Logit / ms
Hello, I am looking for a routine to do a logistic regression. In the book "Modern Applied Statistics with S-PLUS" a function is described which uses the 'ms' command. Is there an analogue for R, or an alternative approach that can accomplish the same thing? Thanks, John. -- ========================================== John Janmaat Department of Economics Acadia
2009 Jul 02
0
MCMCpack: Selecting a better model using BayesFactor
...ing at the values for PostProbMod(BF), one can say that higher posterior probability indicates the better model. Once again, thank you very much for the time you have given. I am looking forward for your reply. Regards, Deb R Code: library(MCMCpack) data(birthwt) model1 <- MCMCregress(bwt~age+lwt+as.factor(race) + smoke + ht, data=birthwt, b0=c(2700, 0, 0, -500, -500, -500, -500), B0=c(1e-6, .01, .01, 1.6e-5, 1.6e-5, 1.6e-5, 1.6e-5), c0=10, d0=4500000, marginal.likelihood="Chib95", mcmc=50000) model2 <- MCMCregress(bwt~age+lwt+as.factor(race) + smoke, data=birthwt, b0=c...
2002 Jan 18
1
RE: z-scores for different factor levels
...2002 5:33 AM To: r-help at stat.math.ethz.ch Subject: [R]: z-scores for different factor levels Hi there. I am trying to generate z-scores for a variable according to it's factor level, leaving this result in the original dataframe. ie. standardised birth weight for gestational age in weeks. BWT is birthweight GEST is gestational age in weeks (equivalent to the factor level) I can generate the factor level mean & SD using tapply tapply(BWT,GEST,mean) etc. but this creates a new array of means & SDs. - Can anyone suggest how I can slot these means & SDs by factor level straigh...
2005 May 12
2
SVM linear kernel and SV
...chanism, 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 wa...
2003 Dec 23
2
[LLVMdev] GCC3.5 tree-ssa
why doesn't llvm transfer bytecode to RTL form? I mean the cross-platform compile in GCC. Could LLVM do that? maybe tree-ssa also create the representation with a testual format if needed. is it very difficalt? I want to know. BWT: if we port pthread library to llvm, what do we consider at first? yueqiang Chris Lattner wrote: >On Wed, 24 Dec 2003, yue wrote: > > >>what difference is between gcc3.5 tree-ssa and llvm? >> >> > >They are completely different projects. The short version...
2002 Jan 09
1
value labels from read.spss()?
>From owner-r-help at stat.math.ethz.ch Wed Jan 9 10:08:44 2002 > >Does anyone know how to access/list the value labels stored in a SPSS .sav >file? >At the moment I can read in variables using read.spss() (foreign package), >but have to power up SPSS to check value labels. > >Stuart There may be a solution to this in R, and I would love to hear it, but I was just faced
2008 Jan 07
1
xtable (PR#10553)
...-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)))
2012 Jul 08
1
Grouped regression
Hi, I 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 su...