Displaying 20 results from an estimated 8000 matches similar to: "Sink does not send graphs to sink file"
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
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
2011 Apr 23
3
Problem having tick marks aligned when plotting three graphs on top of one another.
R 2.10
Windows 7
I am trying to plot three graphs on top of each other. I need to have the axises perfectly aligned. For some reason the ticks on the y axes are slightly off so they do not perfectly align. Can someone tell me how I can get the to overlay each other perfectly? I thought the yaxp parameter would solve my problem, but it does not. My data and code follows:
>
2011 Jan 04
5
Page eject and clearing the console
(1) I know that \n when used in cat, e.g. cat("\n") produces a line feed (i.e. skips to the next line). Is there any escape sequence that will go to the top of the next page?
(2) I know that control L will clear the console. Is there an equivalent function or other means that can be used in R code to clear the console?
Thanks,
John
John David Sorkin M.D., Ph.D.
Chief, Biostatistics
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
2010 Dec 29
6
icon for an R package
I'm looking for an icon to represent an R package. Perhaps something like
http://cdn2.iconfinder.com/data/icons/DarkGlass_Reworked/128x128/apps/package.png
but with the R logo rather than KDE.
--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street Web:
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)
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
2010 Apr 26
4
concise syntax for selecting multiple rows
I would like to select rows if a row contains any one of several values. I can do the selection as follows:
result[,"Subject"]=="JEFF" | result[,"Subject"]=="BG"
But this is very unwieldily if one wishes to select many, many rows as one has to continuously repeat the source:
result[,"Subject"]=="JEFF" |
2007 Oct 01
3
3-dimensional graph
Windows XP
R 2.3.1
I have a funciton
fit1<-lm(y~x+z)
Is there a function that will produce a 3-dimensional plot of y,x,z?
I looked at the help files, but did not find a clean answer to my question.
Thanks,
John
John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
2017 Oct 23
1
Syntax for fit.contrast (from package gmodels)
David,
predict.glm and se.fit were exactly what I was looking for.
Many thanks!
John
John David Sorkin M.D., Ph.D.
Professor of Medicine
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax)
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
2018 Mar 22
3
How do I include a factor in a groupedData object? Meaning and use of inner and outer parameters
Windows 10 64-bit, R-Studio, R version 3.4.3
Several questions relating to groupedData:
(1) I am trying to create a groupedData object that can be used to run an analysis that I have been able to urn using lmer. When I include the interaction terms in the groupedData opbject I get an error message stating that + is not meaningful for factors. How do I include factors in my model? See code and
2008 Sep 20
2
selecting from a series of integers with pre-determined probabilities
R 2.6
Windows XP
I need to select from the integers 1,2,3,4,5 with some pre-determined probability, e.g. probability of selecting 5 80%, probability of selecting 1 or 2 or 3 or 4 20%. Any suggestions for how I might accomplish this? I need to do it very efficiently as I will be doing it 500,000 times.
Thanks
John
John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of
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
2010 Dec 24
3
Passing a data frame or matrix and working with a column of the data frame or matrix
I am trying to learn more about how to write functions. I would like to pass a data frame (or matrix) and depending on the parameters passed to the function work with a given column of the data frame or matrix. My function, learnfn is given below as are two calls to the function. The first call is an attempt to print the x column from the data frame, the second call is an attempt to print the y
2017 Oct 23
0
Syntax for fit.contrast (from package gmodels)
> On Oct 22, 2017, at 5:01 PM, Sorkin, John <jsorkin at som.umaryland.edu> wrote:
>
> 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.
There needs to be a reference value for the contrast. Contrasts are differences. I gave you the choice of two references
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:
2009 Dec 31
4
Obtaining partial output from a function that does not run to completion.
I have written a function that contains runs
lm()
vif() and
glm()
When the glm() blows up with an error message, I don't get the output from either the lm() or vf() even thought neither lm() nor vif() have any problems . How can I force the function to print sequential results rather than wait for the entire function to complete before listing the functhion's output?
Thanks,
John