similar to: too many var in lm

Displaying 20 results from an estimated 5000 matches similar to: "too many var in lm"

2011 Aug 17
3
Obtaining variable's names from a list of variables
Say I have a list of variables,  listVar <- list(age,sex) I am looking for a way to either 1- create a vector c("age","sex") from it, or 2- get the names one by one in a for loop such as these     a)  for (i in 1:length(listVar)) rownames(result)[i] <- ???     b)  for(i in listVar) print (variable's name) Any help much appreciated. [[alternative HTML version
2011 Apr 27
2
ROCR for combination of markers
Dear list   I have 5 markers that can be used to detect an infection in combination. Could you please advise me how to use functions in ROCR/ other package to produce the ROC curve for a combination of markers?   I have used the following to get ROC statistics for each marker. pred <- prediction(y$marker1, y$infectn) perf <-performance(pred,"tpr","fpr")
2011 Aug 17
1
extract variables from model formula
Hi All, I am writing a function to predict values based on a model. It works fine as long as the formula just uses regular variable names. I am having a problem when the variables are wrapped with a function call. For example: m <- lm(mpg ~ factor(cyl), data = mtcars) ## I get the column names using as.character(attr(terms(m), "variables"))[-1L] ## which gives the same column
2012 Aug 02
6
Polygon shaded area
Hi all, I have two vectors (columns) called "efinal" and "efinal 2". I want to plot them on the same plot and "draw" a shaded area beween the two lines using function polygon I have tried all but I don ?t understand the polygon area, can you help me with examples? plot(efinal,type="l",ylim=range(min(efinal2),
2011 Oct 22
7
"Plotting" text?
I noticed that the text() command adds text to a plot. Is there a way to either make the plot blank or add text to a "blank sheet". I would like to "plot" a page that contains just text, no plot lines, labels, etc. Suggestions? Kevin [[alternative HTML version deleted]]
2009 Aug 12
2
Superscripts in axis label
Hi All, I am trying to lable the y-axis on my scatterplot with the following: "Soil moisture content (m3m-3)" I am using the following coding for plotting the graph: plot(soilmoisture~gradientlevel, xlab="Levels of droughting gradient", ylab="Soil moisture content (m3m-3)", bty="l", font.main="2", pch=16, las=1, cex.lab="1.13") I have
2011 Oct 10
3
How to test if two C statistics are significantly different?
Hey all, In order to test if a marker is a risk factor, I built two models (using cox proportional hazard model). One model included this marker, and the other is not. Then, I use R package risksetROC to test how much predictive value did the marker add to this model. I get two C statistics by analyzing the linear predictors of the two models into this package. The qustion is How to test if two
2011 Jul 28
3
construct a data set
Hi, i want to construct a data set similar to "AirPassengers". Its attributes are following. > attributes(AirPassengers) $tsp [1] 1949.000 1960.917 12.000 $class [1] "ts" How Can I construct a data set similar to it having same class and attributes. Thanks -- Amar Kumar Nandan ?:nandan.amar at gmail.com http://aknandan.co.nr
2024 Feb 29
1
[EXT] Initializing vector and matrices
Hello Eik: Thanks. I do not need to sample. Essentially, I have a do loop which produces 24 vectors of length of some length (say k=300) and 24 matrices of 300x300. Then, I simply need to? take the averages of these 24 vectors and matrices: x=(x1+x2+...+x24)/k y=(y1+y2+...+y24)/k I am just looking for ways to do this in a do loop, which requires initialization (to 0's) of x and y. My
2012 Feb 21
2
Using substitute in nested function calls
Dear List members, I really, like the feature that one can call R functions with mathematical expressions, e.g. curve(x^2, 0, 1) I wonder, how I can construct in a simple way a function like mycurve = function (expr) {...} such that that a call mycurve(x^2) has the same effect as the call curve(x^2, -100,100) Below is some code that works, but it seems much to complicated: it first
2011 Mar 14
7
creating character vector
Is there a way to convince R to create a character vector without using the quotes? This works ex1 <- c("first","second") but when I try this it doesn't ext <- as.character(c(first,second)) it complains. I have many variables to put into character vectors so dispensing with the quotes would be useful. Thanks Jim =============================== Dr. Jim Maas
2010 Feb 04
1
how to plot single frames as a movie?
Dear users, 1. Is there a way to create a movie file to play a sequence of single frames (e.g. plots) at a specified time delay between frames? 2. If making a movie file is not possible, then how can I incorporate in a loop some delay between the frames to be plotted so I can change the playing speed? Sorry if this questions was already in the forum, but I couldn?t find it. Thanks in advance
2008 Sep 29
2
density estimate
Hi, I have a vector or random variables and I'm estimating the density using "bkde" function in the KernSmooth package. The out put contains two vectors (x and y), and the R documentation calls y as the density estimates, but my y-values are not exact density etstimates (since these are numbers larger than 1)! what is y here? Is it possible to get the true estimated density at each
2018 Apr 18
1
Problem with regression line
Hi Anne, I would suggest to change the linear model to lm(BloodPressure~Age), as this model makes more sense in biological means (you would assume that age influences pressure, not vice versa) and also obeys the statistical assumption of weak exogeneity, that age can be measured without error, at least compared to error-prone bp measures. Cheers Am 18.04.2018 um 16:07 schrieb Gerrit Eichner:
2011 Feb 09
3
Loop in variable names
Hello! I would like to do some tables for several variables and I would like to write a loop that does the table for each variable. I should also point out that my data set has several missing observations and sometimes the observations that are missing are not the same for all my variables. What I would like to do: table(StoreData$CompanyID, !is.na(StoreData$P2))
2017 Dec 20
1
outlining (highlighting) pixels in ggplot2
I apprecaite the guidance Eik, that works great! I'm also wondering if you have any pointers for how I might stretch the color scale so that the max and min values are the same? Right now, the min is -0.064 and the max is something closer to 0.04. As you can see in what I sent, I tried adding: zmax1 = max(abs(m1)) ggplot(..., autoscale = FALSE, zmin = -1 * zmax1, zmax = zmax1) + ... to
2017 Dec 04
1
ggtern and bquote...
D'oh! Thanks for pointing this out. I blame caffeine depletion at the time... -pd > On 4 Dec 2017, at 15:48 , Eik Vettorazzi <E.Vettorazzi at uke.de> wrote: > > reading ?plotmath you might notice that "_" isn't the propper syntax for > subscripts. This will work: > > ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend = > c(.30,.50,.0),zend
2024 Feb 28
3
Initializing vector and matrices
Is there as way to initialize a vector (matrix) with an unknown length (dimension)? NULL does not seem to work. The lines below work with a vector of length 4 and a matrix of 4 x 4. What if I do not know initially the length/dimension of the vector/matrix? All I want is to add up (accumulate)? the vector and matrix as I go through the loop. Or, are there other ways to accumulate such vectors
2017 Dec 04
1
YNT: ggtern and bquote...
Hi, My example code is this; x11<-data.frame(A=c(.6,.6,.6),B=c(.20,.20,.20),C=c(0.20,.20,.20)) ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend = c(.30,.50,.0),zend =c(.0,.50,0.3)))+ geom_point()+ theme_showarrows()+geom_segment(size=.5)+ geom_text_viewport(x=c(.45,.27,.37),y=c(.32,.29,.22),label=as.expression("P_a","P_b","P_c"))
2018 Feb 22
1
Calculate LC50
Dear All: good morning I need helps with the calculation of the *LC50* from the data below x<-c(0,0.3,0.7,1,4,10) y<-c(100,86,65,51.3,19.2,7.4) yxreg<-lm(y~x) any help will be highly appreciated. with many thanks abou ______________________ *AbouEl-Makarim Aboueissa, PhD* *Professor of Statistics* *Department of Mathematics and Statistics* *University of Southern Maine*