Displaying 20 results from an estimated 9000 matches similar to: "Page eject and clearing the console"
2007 Oct 01
4
data structure with coefficients, and call from lm()
Widows XP
R 2.3.1
I have been trying to make a data structure that will contain both the coefficients from a linear regression along with column and row titles AND the call, i.e.
myreg<-lm(y~x+y+z)
whatIwant<-cbind(c(summary(myreg)$call,"",""),summary(myreg)$coefficients)
Neither the statement above, nor any one of twenty variations I have tried work. I would appreciate
2016 Apr 07
0
using apply to a data frame
??I would like to apply a function, fract, to the columns of a
dataframe. I tried the following
apply(data5NonEventEpochs,2,fract)
but, no surprise it did not work as apply works on matrices not data
frames. How can I apply a fuction to the columns of a data frame? (I
can't covert data5NonEventsEpochs to a matrix as it contains character
data).
Thank you,
John
John David Sorkin M.D., Ph.D.
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
2006 Dec 09
7
Simulation with R
An apparatus exists whereby a collection of balls is displaced to the
top of a stack by suction. A top level (Level 1) each ball is shifted
1 unit to the left or 1 unit to the right at random with equal
probability. The ball then drops down to level 2. At Level 2, each
ball is again shifted 1 unit to the left or 1 unit to the right at
random. The process continues for 15 levels and the balls are
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
2009 Dec 08
2
lm: RME vs. ML
windows XP
R 2.10
As pointed out by Prof. Venables and Ripley (MASS 4th edition, p275), the results obtained from lme using method="ML" and method="REML" are often different, especially for small datasets. Is there any way to determine which method is preferable for a given set of data?
Thanks,
john
John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
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 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
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,
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 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
2017 Oct 23
2
Syntax for fit.contrast (from package gmodels)
David,
Again you have my thanks!.
You are correct. What I want is not technically a contrast. What I want is the estimate for "regional" and its SE. I don't mind if I get these on the log scale; I can get the anti-log. Can you suggest how I can get the point estimate and its SE for "regional"? The predict function will give the point estimate, but not (to my knowledge)
2016 Apr 05
2
Specifying path to a windows server
Windows 7 (local computer)
Windows server (server I am trying to reach)
I need to read a file whose windows path is of the form
\\Theserver\mydirectory\data.csv
You will note that as per windows standards the server name is preceded by two backslashes.
I am not sure how to specify this in R. One usually needs to specify an escape characters in a path new which would suggest my path should
2018 Mar 21
3
Mean of a row of a data frame
I am trying to get the mean of a row of a data frame. My code follows:
roop <- data.frame(x=c(1,2,3),y=c(4,5,2),z=c(0,9,4))
roop
mean(roop[1,])
mean(roop[1,c("x","y","z")])
I get the following output:
> roop
x y z
1 1 4 0
2 2 5 9
3 3 2 4
> mean(roop[1,])
[1] NA
Warning message:
In mean.default(roop[1, ]) :
argument is not numeric or logical:
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.
2016 Apr 17
3
Trying to understand cut
Jeff,
Perhaps I was sloppy with my notation:
I want groups
>=0 <10
>=10 <20
>=20<30
......
>=90 <100
In any event, my question remains, why did the four different versions of cut give me the same results? I hope someone can explain to me the function of
include.lowest and right in the call to cut. As demonstrated in my example below, the parameters do not seem to alter
2012 Mar 28
3
Connect lines in a dot plot on a subject-by-subject basis
I am trying to plot where data points from a give subject are connected by a line. Each subject is represented by a single row of data. Each subject can have
up to five observations. The first five columns of mydata give the time of observation, columns 6-10 give the values at each time point. Some subjects have
all data, some are missing values.
The code I wrote to draw the plot is listed below.
2005 Jul 29
6
Binary outcome with non-absorbing outcome state
I am trying to model data in which subjects are followed through time to
determine if they fall, or do not fall. Some of the subjects fall once,
some fall several times. Follow-up time varies from subject to subject.
I know how to model time to the first fall (e.g. Cox Proportional
Hazards, Kaplan-Meir analyses, etc.) but I am not sure how I can model
the data if I include the data for those
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
2011 Jan 12
5
2d plot with modification of plotting symbol to indicate third dimension.
I would like to plot 3-dimensional data on a two-dimensional scatter-plot.
Is there a way I can automatically modify the plot symbol (e.g. changing size or color) to indicate the value of a third variable? E.g. How can I plot weight vs. age and indicate the value of muscle mass for each value weight-age pair by making the plot point proportional to the subject's muscle mass?
Thanks,
John