Displaying 20 results from an estimated 300 matches similar to: "Making the plot window wider and using the predict function"
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
2009 Feb 04
2
Sweave and \Sexpr{}
Hi:
I am trying to create a dynamic latex table using \Sexpr{} but it's not evaluating it. I also tried the example below without Sweave and also fails. I have also copied the Sweave.sty to my working directory but nothing seems to work. Do I need to have certain package in order to run \Sexpr{}?
\documentclass[a4paper]{article}
\usepackage{C:/R/R-2.8.1/share/texmf/Sweave}
\begin{document}
2012 Apr 03
3
Sweave xtable
Hola
Tengo un problema con Sweave y xtable, concretamente quiero cambiar el color según un criterio, creo que es más fácil explicar con los siguientes ejemplos, uno puede correr directamente porque es R, al siguiente código hay que guardarlo como Rnw, y luego puede ser corrido en R, donde seguramente al correr este se darán cuenta de mis dos problemas porque saltan al abrir el pdf que se obtiene
2008 Jan 07
1
xtable (PR#10553)
Full_Name: Soren Feodor 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)
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
2010 Feb 12
1
validate (rms package) using step instead of fastbw
Dear All,
For logistic regression models: is it possible to use validate (rms
package) to compute bias-corrected AUC, but have variable selection
with AIC use step (or stepAIC, from MASS), instead of fastbw?
More details:
I've been using the validate function (in the rms package, by Frank
Harrell) to obtain, among other things, bootstrap bias-corrected
estimates of the AUC, when variable
2009 Aug 04
0
Problems with lqs()
Dear List-Members,
I have a problem with the function lqs() from package MASS. In some cases it produces different results for the same settings and needs a random seed to be set, in other cases not.
I really cannot understand, why this happens. As well I do not understand what exactly you need the random seed for. Is it a starting point for iterations? Or do different results occur because of
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 length
2: In NEVER & UNTILPREGNANT & ONCENOTNOW
2010 Oct 12
1
Help with function writing
Hello all
I have what seems like a simple question but have not been able to find an
answer on the forum. I'm trying to define a function which involves
regression models and a large number of covariates.
I would like the function to accept any number of covariates and, ideally, I
would like to be able to enter the covariates in a group (e.g. as a list)
rather than individually. Is there any
2018 May 30
1
CRAN checks give errors when no tests are included
Dear all,
as a follow-up to the question asked on R-package-devel (see link below):
Someone sent a package to CRAN with a few problems. There's more things
wrong with the submission, but one thing that really caught my eye was the
following error:
Warning message:
running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD BATCH --vanilla
"testthat.R"
2005 May 12
2
SVM linear kernel and SV
Dear all,
I'm a trainee statistician in a company and we'd like to understand svm
mechanism, 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
2007 Jul 05
17
ZFS Compression algorithms - Project Proposal
Bellow, follows a proposal for a new opensolaris project. Of course,
this is open to change since I just wrote down some ideas I had months
ago, while researching the topic as a graduate student in Computer
Science, and since I''m not an opensolaris/ZFS expert at all. I would
really appreciate any suggestion or comments.
PROJECT PROPOSAL: ZFS Compression Algorithms.
The main purpose of
2002 Jan 18
1
RE: z-scores for different factor levels
Hi Stuart,
I often use this small function
standardize <- function(x) ( x - mean(x, na.rm=T) ) / sqrt(var(x,
na.rm=T))
to standardize variables.
You should be able to use this to do what you want by splitting the data
frame into sections based on the factor level, using standardize() to create
a new variable in each section, then paste the data frame back together.
Something like:
#
2010 May 05
1
puzzles with assign()
I'm trying to get code along the following lines to work:
temp.name <- paste(TimePt,'df',sep='.') # invent a relevant name/symbol as a
character string.
assign(temp.name,IGF.df[IGF.df$TPt==TimePt,]) # this works. The relevant
variable is now a data frame
lm(b ~ Strain+BWt+PWt+PanPix, data=temp.name)) # this gives an error, namely
Error in eval(predvars, data, env) : invalid
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
2008 Dec 19
0
"parm" argument in confint.multinom () nnet package
Dear R users,
The nnet package includes the multinom method for the confint function.
The R Help file (?confint) for the generic function in the stats package
and the help files for the glm and nls methods in the MASS package
indicate that one can use the "parm" argument as "a specification of
which parameters are to be given confidence intervals, either a vector
of numbers or
2003 Dec 23
2
[LLVMdev] GCC3.5 tree-ssa
we work on distribute software development, most programs are wroten in
java.
but the running speed of that is slowly, it requires thread library to
support, you know.
Chris Lattner wrote:
>On Wed, 24 Dec 2003, yue wrote:
>
>
>
>>why doesn't llvm transfer bytecode to RTL form? I mean the
>>cross-platform compile in GCC. Could LLVM do that?
>>
>>
2009 Apr 26
1
Stochastic Gradient Ascent for logistic regression
Hi. guys,
I am trying to write my own Stochastic Gradient Ascent for logistic
regression in R. But it seems that I am having convergence problem.
Am I doing anything wrong, or just the data is off?
Here is my code in R -
lbw <-
read.table("http://www.biostat.jhsph.edu/~ririzarr/Teaching/754/lbw.dat"
, header=TRUE)
attach(lbw)
lbw[1:2,]
low age lwt race smoke ptl ht ui ftv
2003 Dec 23
0
[LLVMdev] GCC3.5 tree-ssa
On Wed, 24 Dec 2003, yue wrote:
> why doesn't llvm transfer bytecode to RTL form? I mean the
> cross-platform compile in GCC. Could LLVM do that?
Sure, it would be a realtively straight-forward (but large and hard to get
right, if you're not a GCC expert), project to build an LLVM front-end for
GCC. This would allow you to effectively use LLVM as a mid-level
representation for
2003 May 03
1
expand.grid
I recently posted a question concerning an inconsistency of
expand.grid in defining the reference level of the factors.
> > expand.grid(x = c("b", "a"), y = c(1, 2))$x
> [1] b a b a
> Levels: b a # reference level is b
> > expand.grid(x = c("b", "a"))$x
> [1] b a
> Levels: a b # reference level is a
Thank you