Displaying 20 results from an estimated 126 matches for "bmi".
Did you mean:
bi
2008 Mar 17
1
Std errors in glm models w/ and w/o intercept
...idered the
baseline, and that I should estimate each level compared with that
baseline. "18.5-24.9" was used as the reference level in the model with
intercept. Removing the intercept appears to be a "successful"
strategy. but have I committed any statistical sin?
> with(bmi, table(BMI,Actual_Deaths))
Actual_Deaths
BMI 0 1 2 3 4 5 6 7 11 13
18.5-24.9 311 21 1 0 0 0 0 0 0 0
15.0-18.4 353 33 8 2 0 1 0 0 0 0
25.0-29.9 367 19 0 0 0 0 0 0 0 0
30.0-34.9 349 95 39 17 8 9 3...
2005 Nov 29
2
permutation test for linear models with continuous covariates
Hi I was wondering if there is a permutation test available in R for linear
models with continuous dependent covariates. I want to do a test like the
one shown here.
bmi<-rnorm(100,25)
x<-c(rep(0,75),rep(1,25))
y<-rnorm(100)+bmi^(1/2)+rnorm(100,2)*x+bmi*x
H0<-lm(y~1+x+bmi)
H1<-lm(y~1+x+bmi+x*bmi)
anova(H0,H1)
summary(lm(y~1+x+bmi))
But I want to use permutation testing to avoid an inflated p-value due to a
y that is not totally normal distributed...
2011 Oct 06
1
error messages
Im doing a project using Rcommander. I have a dataset with 5 variables, BMI being one of them. I would like to find the variance, standard deviation, range, median, etc of BMI. However, everytime I type a command into the script window, (such as var(BMI$BMI,na.rm=TRUE) )an error message pops up saying Object "BMI" not found. I can graph it, work it, do t-test, et...
2011 Jan 23
2
Creating subsets of a matrix
Hello,
Say I have 2 columns, bmi and gender, the first being all the values and the
second being male or female. How would I subset this into males only and
females only? I have searched these fora and read endlessly about select[]
and split() functions but to no avail. Also the table is not ordered.
bmi gender ->...
2015 Aug 02
3
ayuda con análisis de supervivencia
Hola a todos,
-Estoy estudiando el efecto de dos genotipos (~tratamientos) en la aparición de síndrome metabólico (MetS) con datos longitudinales recogidos a tiempo 0,7,10,15,20 y 25 años.
-He hecho un dataframe con las siguientes variables
MetS: Síndrome Metabólico (Si=1,No=0)
bmi: Indice de masa corporal (IMC) cuando se produce la conversión a MetS+ . Para los que permancen MetS-, esta variable indica el bmi cuando hay censura (por abandono del estudio o al finalizar el estudio en el año 25).
bmi0: IMC al inicio del estudio (categórica, levels=normal/overweight/obese)
apoE4...
2005 Jun 02
3
How to change all name of variables
Dear R-helpers,
First I apologize if my question is quite simple
I have a large datasets which more 100 variables.
For a research I need to change all name of variables with add one or
more letters on each variables.
For example,
> data(Pima.tr)
> Pima.tr[1:5,]
npreg glu bp skin bmi ped age type
1 5 86 68 28 30.2 0.364 24 No
2 7 195 70 33 25.1 0.163 55 Yes
3 5 77 82 41 35.8 0.156 35 No
4 0 165 76 43 47.9 0.259 26 No
5 0 107 60 25 26.4 0.133 23 No
>
> dimnames(Pima.tr)[[2]]
[1] "npreg" "glu" "bp&...
2010 Apr 19
1
BRugs
Hi. I am new here, and I am writing this Winbugs code with BRugs.
n=length(bi.bmi)
Lagegp=13
Lgen=2
Lrace=5
Lstra=15
Lpsu=2
#model gen x race
bi.bmi.model=function(){
# likelihood
for (i in 1:n){
bi.bmi[i]~ dbern(p[i])
logit(p[i])<- a0 + a1[agegp[i]]+a2[gen[i]]+a3[race[i]]
+ a12[agegp[i], gen[i]]
+ gam[stra[i]]+ u[psu[i],stra[i]] }
# constraints for a1, a2, a3,...
2009 May 15
2
help with as.numeric
hi everyone, wondering if you could help me with a novice problem. I have a
data frame called subjects with a height and weight variable and want to
calculate a bmi variable from the two. i have tried:
attach(subjects)
bmi <- (weight)/((height/100)^2)
but it comes up with the error:
Warning messages:
1: In Ops.factor(height, 100) : / not meaningful for factors
2: In Ops.factor((weight), ((height/100)^2)) :
/ not meaningful for factors
I presume that t...
2006 Aug 03
2
run self written functions
Hello,
I'm not sure if I'm in the right place with my question...
I'm running R on Windows and wrote a function and saved it as .R file.
It looks like this:
bmi <- function(weight, height) {
bmi <- weight / height^2
bmi
}
If I want to use this function, I have to mark everything and then press
Ctrl-R. But then everything single line is executed on the command line,
which means that I will "loose" my history when the code becomes...
2008 Jan 01
3
if statement problem
Hi All,
I have a small dataset named das (43 cases) in which I am trying to
create a binary outcome (1/0) based on the following code:
if (das$age>65 && das$bmi>30) {das$danger<-1} else das$danger<-0
I am setting a flag called 'danger' to 1 of the subject is over 65
and has a BMI > 30.
I find that my statement evaluates the first record in the data.frame
and then carries that assignment for all. I detected this as I played
around w...
2018 Apr 25
0
Zero errors : Bug in my R code ?
...ot;kloke/hbrfit") #install.packages('http://www.stat.wmich.edu/mckean/Stat666/Pkgs/npsmReg2_0.1.1.tar.gz')
#install.packages("DMwR")
library(robustbase)
library(MASS)
library(quantreg)
library(RobPer)
library(hbrfit)
library("devtools")
library("DMwR")
bmi=c(23,43,12,1,23,4,3,4,5,5,6,5,5,34,67,87,32,12,23,19)
glucose=c(98,34,21,13,2,43,16,43,28,93,11,14,16,43,23,65,42,16,54,32)
crp=c(56,34,42,32,1,2,54,47,67,65,38,95,45,76,67,87,35,41,34,54)
newdata=data.frame(bmi,glucose,crp)
?
reg1 <- lm( crp ~ bmi+glucose,data=newdata)
DMwR::regr.eval(newdata$...
2018 May 21
2
Bootstrap and average median squared error
...n 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 <-c(34,32,12,76,54,34,21,18,92,32,11,13,45,46,56,57,67,87,12,13)
glucose <-c(23,54,11,12,13,21,32,12,45,54,65,87,21,23,12,12,23,23,43,54)
# Create a list to store the results
lst<-list()
# Numbers of bootstrap samples
nboot=100
bootstrap.MedAESQ =rep(NA,nboot)
for(i in 1?:nboot)
{
fit...
2010 Oct 25
2
Question on passing the subset argument to an lm wrapper
...ng the following situation?
This is on R 2.12.0 on Ubuntu 32-bit.
I have a wrapper function to lm. I want to pass in a
subset argument. First, I just thought I'd use "...".
## make example reproducible
set.seed(123)
df1 <- data.frame(age = rnorm(100, 50, 10),
bmi = rnorm(100, 30, sd = 2))
## create a wrapper using "..."
testlm <- function(formula, ...) {
lm(formula, data = df1, ...)
}
> testlm(bmi ~ age, subset = age > 50)
Error in eval(expr, envir, enclos) :
..1 used in an incorrect context, no ... to look in
I found some othe...
2012 Jan 26
2
How do I use the cut function to assign specific cut points?
I am new to R, and I am trying to cut a continuous variable BMI into
different categories and can't figure out how to use it. I would like to cut
it into four groups: <20, 20-25, 25-30 and >= 30. I am having difficulty
figuring the code for <20 and >=30? Please help. Thank you.
--
View this message in context: http://r.789695.n4.nabble.com/How...
2010 Sep 23
1
How to pass a model formula as argument to with.mids
...h.mids functon fits models to
multiply imputed data sets.
Here's a simple example
library(mice)
#Create multiple imputations on the nhanes data contained in the mice
package.
imp <- mice(nahnes)
#Fitting a linear model with each imputed data set the regular way works
fine
with(imp, lm(bmi~hyp+chl))
#Creating a formula object and than passing it as argument does not work:
form.obj <- formula(bmi~hyp+chl)
with(imp, lm(form.obj))
#The following doesn't work either
expr <-"lm(bmi~hyp+chl)"
with(imp, expr)
Looking at the definition of with.mids reveals that the sec...
2011 Aug 23
1
Testing Specific Hypothesis
Hi All!
I am interested in testing whether the means for the data I am investigating
are equal to a specific value - let's say 0.01. I have already run a
one-way ANOVA and know that the differences in the means are not
significant, so now I want to know what values the means take on. "otestme"
is the data I am working with (it would be hard for me to get into a form
that would be
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 <- data.frame(crp, bmi, glucose)
nboot <- 100
medse <- boot(dat, bootMedianSE, R = nboot)
medse$t0
mean(medse$t) # This is the value you want
Hope this helps,
Rui Barrad...
2008 Dec 07
1
Reading txt file in R
...im(anal.data) [1] # number of data points
n.params <- dim(anal.data)[2] - 2 # number of parameters to estimate
n.sites <- length(unique(SITEID))
data.bugs <- list("NAUSEA"=NAUSEA,"SITEID"=SITEID,"BMI"=BMI, "USUBJID"=USUBJID,"n.samples"=n.samples,"n.sites"=n.sites,"n.params"=n.params)
bugsData(data.bugs, fileName = "nauseadata.txt")
inits.bugs <- list("b"=rep(0,n.params),"alpha"=rep(0,n.sites), "tau"=1)
bugsI...
2018 May 22
2
Bootstrap and average median squared error
...> 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 <- data.frame(crp, bmi, glucose)
> nboot <- 100
>
> medse <- boot(dat, bootMedianSE, R = nboot)
>
> medse$t0
> mean(medse$t)???...
2018 Jan 07
2
Beginner question: Calling intrinsic
Hello,
I’m not sure if this is the right place to ask beginner questions.
If not, please direct me to the appropriate place.
I’m writing my first llvm program and I’m trying to call an intrinsic, but
failing.
So far this is what I have:
declare ccc i32 @llvm.x86.bmi.pdep.32(i32, i32)
@.str2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
declare i32 @printf(i8*, ...) nounwind
; Definition of main function
define i32 @main() {
%res = call ccc i32 (i32, i32) @llvm.x86.bmi.pdep.32( i32 1, i32 1 )
%a = alloca i32, align 8
%1 = loa...