Displaying 20 results from an estimated 80 matches for "ldpli".
Did you mean:
ldply
2010 May 17
2
Problem with ldply
I've examining a number of linear regression models on a large dataset
following the basic ideas presented here
http://www.r-bloggers.com/r-calculating-all-possible-linear-regression-models-for-a-given-set-of-predictors/
Calculating all possible linear regressions . I run into a problem with
ldply when I have a formula that includes no intercept. Here's a simple test
to show what happens.
2011 Jan 07
2
how to run linear regression models at once
hey, folks,
I have two very simple questions. I am not quite sure if I can do this using
R.
so, I am analyzing a large data frame with thousands of variables. For
example:
Dependent variables: d1, d2, d3 (i.e., there are three dependent variables)
Independent variables: s1, s2, s3, ......s1000 (i.e., there are 1000
independent variables)
now I want to run simple linear regression analyses of
2011 Jun 27
2
Executing the same function on consecutive files
Hi all,
I have the next problem: I have a matrix with size 8,000,000x18. My personal
computer...blocks...so I have cut my original file into 100 different file.
I have written a function that should be run on each of this file.
So imagine
I need to read data from q1 to q100 file
data<-read.table("q1.txt",sep="")
and each time I read 1 file execute my personal function
2012 Apr 29
1
r2 and p value dispaly in table
Hello R User,
I was trying to display r.squared and p value in table from regression, but I could not display these parameters in the table (matrix)
for example
individual <- c(1,1,6,8,8,9,9,9,12,12)
day <- c(4,17,12,12,17,3,9,22,13,20)
condition <- c(0.72, 0.72, 0.67, 0.73, 0.76, 0.65, 0.68, 0.78, 0.73, 0.71)
test <- data.frame(individual, day, condition)
ind.id <-
2010 Aug 09
2
coef(summary) and plyr
Dear all,
I?m having trouble getting a list of regression variables back into a dataframe.
mydf <- data.frame(x1=rnorm(100), x2=rnorm(100), x3=rnorm(100))
mydf$fac<-factor(sample((0:2),replace=T,100))
mydf$y<- mydf$x1+0.01+mydf$x2*3-mydf$x3*19+rnorm(100)
dlply(mydf,.(fac),function(df) lm(y~x1+x2+x3,data=df))->dl
here I?d like to use
ldply(dl,coef(summary)) or something
2012 Apr 04
1
Subscript Error
json_dir is a list of JSON lists mapping lat/long route points between
locations using CloudMade's API.
post_url is the URL of the HTTP request
for (n in json_dir) {
i = i + 1
if (typeof(json_dir[[i]]) != "NULL") {
if (i == 1) {
dat_add <- ldply(json_dir[[i]], function(x)
t(data.frame(x)), .progress = "text")
2018 Apr 17
2
Time intervals in a datframe
Hi all
I have a list of multiple datframes with the same column headers. The last column in each datframe contains a vector of "Interval" class after I have produced this column using "lubridate" package. I needed to convert my list of dataframes to be in a single dataframe for further analysis. I did this using the following syntax :
SingleDataframe <- ldply
2011 Jul 14
1
glm() scale parameters and predicted Values
In glm() you can use the summary() function to recover the shape parameter (the reciprocal of the dispersion parameter). How do you recover the scale parameter? Also, in the given example, how I estimate and save the geometric mean of the predicted values? For a simple model you can use fitted() or predicted() functions. I will appreciate any help.
?
?
?
#Call required R packages
require(plyr)?
2011 Aug 25
2
how to read a group of files into one dataset?
for example : I have files with the name
"ma01.dat","ma02.dat","ma03.dat","ma04.dat",I want to read the data in
these files into one data.frame
flnm<-paste("obs",101:114,"_err.dat",sep="")
newdata<-read.table(flnm,skip=2)
data<-(flnm,skip=2)
but the data only contains data from the flnm[1]
I also tried as below :
for
2018 Apr 17
0
Time intervals in a datframe
> On Apr 17, 2018, at 10:10 AM, Allaisone 1 <allaisone1 at hotmail.com> wrote:
>
>
> Hi all
>
> I have a list of multiple datframes with the same column headers. The last column in each datframe contains a vector of "Interval" class after I have produced this column using "lubridate" package. I needed to convert my list of dataframes to be in a single
2011 May 23
6
Reading Data from mle into excel?
Hi there,
I ran the following code:
vols=read.csv(file="C:/Documents and Settings/Hugh/My Documents/PhD/Swaption
vols.csv"
, header=TRUE, sep=",")
X<-ts(vols[,2])
#X
dcOU<-function(x,t,x0,theta,log=FALSE){
Ex<-theta[1]/theta[2]+(x0-theta[1]/theta[2])*exp(-theta[2]*t)
Vx<-theta[3]^2*(1-exp(-2*theta[2]*t))/(2*theta[2])
dnorm(x,mean=Ex,sd=sqrt(Vx),log=log)
}
2011 Nov 26
2
simplify source code
Hi
I would like to shorten
mod1 <- nls(ColName2 ~ ColName1, data = table, ...)
mod2 <- nls(ColName3 ~ ColName1, data = table, ...)
mod3 <- nls(ColName4 ~ ColName1, data = table, ...)
...
is there something like
cols = c(ColName2,ColName3,ColName4,...)
for i in ...
mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...)
I am looking forward to help
Christof
2010 Jul 29
2
Multiple binomial tests on a large table
I need to run binomial tests (binom.test) on a large set of data, stored
in a table - 600 tests in total.
The values of x are stored in a column, as are the values of n. The
data for each test are on a separate row.
For example:
X N
11 19
9 26
13 21
13 27
18 30
It is a two-tailed test, and P in all cases is 0.5.
My question is: Is there a quicker way of running these tests without
having to
2012 Dec 05
4
Import multiple data frames and combine them using "cbind"
Hi group,
I imported 16 data frames using the function "list.files"
temp <- list.files(path="...........")
myfiles = lapply(temp, read.table,sep = "")
Now I have 16 data set imported in R window.
I want to combine them by row and tried some thing like (Here I am
considering only 20 columns)
for(i in 1:16){
data<- cbind(myfiles[[i]][,1:20])
}
but it
2011 Aug 29
2
splitting into multiple dataframes and then create a loop to work
Dear All
Sorry for this simple question, I could not solve it by spending days.
My data looks like this:
# data
set.seed(1234)
clvar <- c( rep(1, 10), rep(2, 10), rep(3, 10), rep(4, 10)) # I have 100
level for this factor var;
yvar <- rnorm(40, 10,6);
var1 <- rnorm(40, 10,4); var2 <- rnorm(40, 10,4); var3 <- rnorm(40, 5, 2);
var4 <- rnorm(40, 10, 3); var5 <- rnorm(40, 15,
2009 Mar 21
3
Retrieving Vertices Coordinates from SpatialPolygons
Dear List,
I'm trying to use different R packages for my Teaching Assistantship
classes. And I cam out to an (apparently) very simple problem. I would
like to retrieve the vertices coordinate of a SpatialPolygon data. I
know this is stored in the "coords" slot, but I can't get access to
it! I tried to coerce the SpatialPolygon into a data.frame but it
doesn't work.
2011 Jan 21
2
Looping with incremented object name and increment function
Folks,
I am trying to get a loop to run which increments the object name as part of
the loop. Here "fit1" "fit2" "fit3" and "fit4" are linear regression models
that I have created.
> for (ii in c(1:4)){
+ SSE[ii]=rbind(anova(fit[ii])$"Sum Sq")
+ dfe[ii]=rbind(summary(fit[ii])$df)
+ }
Error in anova(fit[ii]) : object 'fit' not found
2011 Aug 01
2
Errors, driving me nuts
Greetings all,
I am getting this error that is driving me nuts... (not a long trip, haha)
I have a set of files and in these files I want to calculate ttests on
rows 'compareA' and 'compareB' (these will change over time there I
want a variable here). Also these files are in many different
directories so I want a way filter out the junk... Anyway I don't
believe that this is
2011 Oct 14
3
Split a list
I have a list of dataframes i.e. each list element is a dataframe with three columns and differing number of rows. The third column takes on only two values. I wish to split the list into two sublists based on the value of the third column of the list element.
Second issue with lists as well. I would like to reduce each of the sublist based on the range of the second column, i.e. if the range of
2010 Sep 09
0
Fast / dependable way to "stack together" data frames from a list
Hi, everybody:
I asked about this in r-help last week and promised
a summary of answers. Special thanks to the folks
that helped me understand do.call and pointed me
toward plyr.
We face this problem all the time. A procedure
generates a list of data frames. How to stack them
together?
The short answer is that the plyr package's rbind.fill
method is probably the fastest method that is not