Displaying 20 results from an estimated 10000 matches similar to: "Multivariable correlation"
2007 Jan 18
3
selecting rows for inclusion in lm
I am having trouble selecting rows of a dataframe that will be included
in a regression. I am trying to select those rows for which the variable
Meno equals PRE. I have used the code below:
difffitPre<-lm(data[,"diff"]~data[,"Age"]+data[,"Race"],data=data[data[,"Meno"]=="PRE",])
summary(difffitPre)
The output from the summary indicates that
2006 Nov 21
2
sample size for linear regression
Is there an R function that can be used to calculate a sample size for a
linear regression:
i.e.
Given a linear regression:
y=f(x,z)
i.e. fit1<-lm(y~x+z)
is there a function which can be passed coef(z), SE(z), and other
parameters to determine a sample size based on z, SEz and other
information from the regression?
Thanks,
John
John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
2013 Feb 05
3
Non linear programming: choose R that minimizes corr(y, x^R)
I am looking for a package that will allow me to choose R (a real number) that minimizes the correlation of y and x^R, i.e.
find R such that corr(y,x^R) is minimized. Any suggestions for packages I might look at would be helpful.
Thanks,
John
John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA
2008 Oct 16
1
apply, t-test and p-values
R 2.7.2
Windows XP
I am using apply to compute a series of Student's t-test from two matrices, sample1 and sample2.
boo<-apply(sample1,1,t.test,sample2)
I want to pick of the p-values from the tests, but can't seem to get it to work. I have tried several methods to get the values including:
boo<-apply(sample1,1,t.test$t.test,sample2)
boo<-apply(sample1,1,t.test,sample2)$t.test
2007 Mar 06
5
Recalling and printing multiple graphs. Is there something in the HISTORY menu that will help?
I have written an R function that produces multiple graphs. I use
par(ask=TRUE) to allow for the inspection of each graph before the next
graph is drawn. I am looking for a way to recall all graphs drawn in an
R session, and a method that can be used to print all the graphs at one
time. I know that I could simply print each graph after I inspect the
graph, but this gets tiresome if one's
2006 Oct 14
2
regression analyses using a vector of means and a variance-covariance matrix
R 2.2.0
windows XP
How can I perform a regression analyses using a vector of means, a
variance-covariance matrix? I looked at the help screen for lm and did
not see any option for using the afore mentioned structures as input to
lm.
Thanks,
John
John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
Baltimore VA Medical Center GRECC,
University of Maryland School of Medicine Claude D.
2007 Mar 26
4
Problem dropping rows based on values in a column
I am trying to drop rows of a dataframe based on values of the column PID, but my strategy is not working. I hope someoen can tell me what I am doing incorrectly.
# Values of PID column
> jdata[,"PID"]
[1] 16608 16613 16355 16378 16371 16280 16211 16169 16025 11595 15883 15682 15617 15615 15212 14862 16539
[18] 12063 16755 16720 16400 16257 16209 16200 16144 11598 13594 15419 15589
2006 Jul 10
1
How can I obtain the values of BIAS and STD. ERROR from a bootstrap.
R 2.3.1
Windows XP
Question: How can I obtain the values of BIAS and STD. ERROR from a
bootstrap.
Background:
I am running a bootstrap:
result2<-boot(1:400,regSEvssample,R=5000)
and obtain the following results:
Bootstrap Statistics :
original bias std. error
t1* 1.876602 -0.0001368616 0.1630380
I would like to get the values of ORIGINAL and BIAS. I can get the
value of
2006 Jul 03
6
macro facility in R
R 2.2 on windows XP
I have a dataset with multiple columns. Some of the columns represent
independent variables, some represent dependent variables. I would like
to run the same analyses on a fixed set of independent variables,
changing only the dependent variable, e.g.
y1-y2=x1+x2+x3
y3-y4=x1+x2+x3
y5-y6=x1+x2+x3, etc.
I know I can write a function to perform the analyses, however in order
to
2007 Nov 21
3
Packages - a great resource, but hard to find the right one.
Fellow Rers,
Please forgive me if I have posted this to the wrong R list serve.
Over the course of the years that I have used R and participated in this list server, I have noted a large number of questions and answers that direct people to specific packages. The multitude of packages is one of the great strengths of R. Unfortunately there is no (or at least I am not aware of) any single source
2006 Nov 05
2
solution to a regression with multiple independent variable
Please forgive a statistics question.
I know that a simple bivariate linear regression, y=f(x) or in R
parlance lm(y~x) can be solved using the variance-covariance matrix:
beta(x)=covariance(x,y)/variance(x). I also know that a linear
regression with multiple independent variables, for example y=f(x,z)
can also be solved using the variance-covariance matrix, but I don't
know how to do this.
2008 Mar 02
3
emacs and R
At the suggestion of many people, I have installed emacs on my linux (Fedora 8.0) computer with the intention of using emacs as window interface to R (2.6.0). I have gone though the emacs tutorial and don't see any information about how I should use emacs to run R. Can anyone suggest a document that I might read? In the past I have used R on a Windows XP system and used the built-in windowing
2010 Jul 06
2
Rcmdr installation under Unbuntu installatiion errors
Unbuntu 10.04
R 2.10
I am trying to install Rcmdr and receive the following messages:
The downloaded packages are in
?/tmp/RtmpzhjDZG/downloaded_packages?
Warning messages:
1: In install.packages("Rcmdr", dependencies = TRUE) :
installation of package 'Rmpi' had non-zero exit status
2: In install.packages("Rcmdr", dependencies = TRUE) :
installation of package
2009 Feb 20
2
Problems installing RODBC as part of Rcmdr and as separate package
Fedora 10
R 2.8.1
I hope someone can tell me the meaning of error I received trying to install RODBC and how I can get around the problem.
n.b. The error originally occurred then I was installing Rcmdr. I then tried to install RODBC separately and received the same error.
checking sql.h usability... no
checking sql.h presence... no
checking for sql.h... no
checking sqlext.h usability... no
2006 Aug 03
1
Looking for transformation to overcome heterogeneity ofvariances
Peter
You question is difficult to answer without more information about the
distribution of your residuals. Different residual patterns call for
different transformations to stabilize the variance. One very common
form of heterocedasticity is increasing variance with increasing values
of an independent predictor, i.e. the variance of the residuals of y=x
increase as x increases. In this case a
2007 Feb 05
2
Two ways to deal with age in Cox model
I hope one and all will allow a stats question:
When running a cox proportional hazards model ,there are two ways to
deal with age,
including age as a covariate, or to include age as part of the
follow-up time, viz,
Age as a covariate:
tetest1 <- list(time= c(4, 3,1,1,2,2,3),
status=c(1,NA,1,0,1,1,0),
age= c(0, 2,1,1,1,0,0),
2005 Jul 15
3
Dividing a vector into ntiles
R 2.1.1
Win 2k
Would someone suggest a method (or methods) that can be used to
determine ntile cutpoints of a vector, i.e. to determine values that can
be used to divide a vector into thirds such as 0-33 centile, 34-66
centile, 67-100 centile. If for example I had a vector:
1,2,3,4,5,6,7,8,9
and wanted to divide the vector into thirds
I would have cut-points of 3, and 6.
Thanks,
John
John
2005 Jul 28
4
CSV file and date. Dates are read as factors!
I am using read.csv to read a CSV file (produced by saving an Excel file
as a CSV file). The columns containing dates are being read as factors.
Because of this, I can not compute follow-up time, i.e.
Followup<-postDate-preDate. I would appreciate any suggestion that would
help me read the dates as dates and thus allow me to calculate follow-up
time.
Thanks
John
John Sorkin M.D., Ph.D.
Chief,
2006 May 12
4
Title of page with multiple plots
I want to place four plots on a page, and I would like to have all four
plots share a common title. I have tried the following code, but the
title is centered over the fourth graph and not centered across all four
plots. Does anyone have any suggestions?
R 2.1.1
windows xp
oldpar<-par(mfcol =c(1,4),ask=TRUE)
plot(p,varp)
plot(p,SEp)
plot(p,CVp)
plot(p,ppval)
title(paste("P and 95%CI
2010 Sep 10
1
lme, groupedData, random intercept and slope
Windows Vista
R 2.10.1
Does the following use of groupedData and lme produce an analysis with both random intercept and slope, or only random slope?
zz<-groupedData(y~time | Subject,data=data.frame(data),
labels = list( x = "Time",
y = "y" ),
units = list( x = "(yr)", y = "(mm)")
)
plot(zz)