similar to: Converting a pdataframe into dataframe

Displaying 20 results from an estimated 6000 matches similar to: "Converting a pdataframe into dataframe"

2012 May 07
1
Taking a lead in panel data
Dear R users, I am working with panel data and I want the difference of a variable with its t+1 value. For example, I have a data frame as below. > a <- data.frame(c(rep(2,5), rep(3,5)), c(2005:2009, 2004:2008), c(NA,10,34,23,12, 23,45, NA, 45, NA)) > colnames(a) <- c("firm","year","var") I want the output to be as follows. > b <-
2009 May 08
1
plm: plm.data vs pdata.frame
Hello, I am trying to use the plm package for panel econometrics. I am just trying to get started and load my data. It seems from most of the sample documentation that I need to use the pdata.frame function to get my data loaded. However, even after installing the "plm" package, my R installation cannot find the function. I am trying to follow the example in plmEN.pdf (
2013 May 17
2
How could I see the source code of functions in an R package?
Hi, How could I see the source code of functions in an R package? If we type ?function_name , we will see documentations of the function_name. If we type function_name, is what returns just the source code? Could we just save it in an .R file and modify as we want? However, it seems that sometimes the source code is hidden (or stored elsewhere?) As an example, could we see the source
2006 Nov 22
3
dataframe manipulation
Hi, Having a dataframe 'l1' (dput output is below): >dim(l1) 1274 2 >l1[1:12,] Var1 Freq 1 1988-01-13 1 2 1988-01-16 1 3 1988-01-20 3 4 1988-01-25 2 5 1988-01-30 1 6 1988-02-01 5 7 1988-02-08 4 8 1988-02-14 1 9 1988-02-16 1 10 1988-02-18 4 11 1988-02-24 2 12 1988-03-04 1 I want to extract the times
2018 Feb 11
2
Hausman test
Hello, I have a problem with Hausman test. I am performing my analysis with these commands: > library(plm) > data<-read.csv2("paolo.csv",header=TRUE) > data< pdata.frame(data,index=c("FIRM","YEAR"),drop.index=TRUE,row.names=TRUE) > RECEIV~LSIZE+LAGE+LAGE2+CFLOW+STLEV+FCOST+PGROWTH+NGROWTH+TURN+GPROF+GPROF2 >
2011 Oct 28
2
Faster process for creating a matrix based on matrix element comparison
I have matrix data data<-matrix(cbind(c(0,0,0),c(NA,0,1),c(1,1,1),c(0,1,1)),ncol=3) and I want to create a new matrix by checking each element of the data and put value 0 if i have NA and 1 otherwise. For this reason i made the function below pdata<-matrix(NA,ncol=ncol(data),nrow=nrow(data)) pdata<-sapply(1:nrow(data),function(i) sapply (1:ncol(data),function(j) if (is.na(data[i,j]))
2011 Sep 22
2
the opposite of lag() in panel data
Hi R-helpers I want a function that performs the opposite of lag() with panel data. I have transformed my data before with pdata.frame(mydata, index=c("groupindex", “timeindex")) And then I’ve done lag(mydata, -1) but it doesn’t work. The error message was: Error in rep(1, ak) : invalid ''times'' argument Thank you in advance, Cecília Carmo
2004 Feb 18
1
Precache an entire OGG?
OK, thanks to the help of another forum user, I got my app compiled and working, but I now need to precache the OGG to memory. My current method somehow winds up in a loop or freezes the application. Here is y source for the decode/precache function. Why is it just freezing? I've let it run for about three minutes, thinking it was doing some heavy decoding, but I was wrong. Once this is
2011 Jul 10
1
Code Help
Am I missing a Package? I'm not sure why is won't read the functions. Any help is much appreciated. > PData = Data[,3:10] > Spec = portfolioSpec() Error: could not find function "portfolioSpec" > setTargetReturn(Spec) = mean(colMeans(PData)) Error in setTargetReturn(Spec) = mean(colMeans(PData)) : object 'Spec' not found > Constraints =
2018 Feb 11
0
Hausman test
Note the typo in your 3rd line: data < Don't know if this means anything... Bert On Feb 11, 2018 7:33 AM, "PAOLO PILI" <paolo.pili at student.unife.it> wrote: > Hello, > > I have a problem with Hausman test. I am performing my analysis with these > commands: > > > library(plm) > > data<-read.csv2("paolo.csv",header=TRUE) >
2005 Jun 23
1
Stop Warnings for Invalid Factor Level, NAs generated?
How can I stop the following warning from occuring? invalid factor level, NAs generated in: "[<-.factor"(`*tmp*`, iseq, value = structure(1, .Label = "12", class = "factor")) The Label messages are for "5", "8", "12" and "46". I want the NAs to be generated as needed. Is this causing R to slow down by generating the warning
2012 Mar 08
1
Panel models: Fixed effects & random coefficients in plm
Hello, I am using {plm} to estimate panel models. I want to estimate a model that includes fixed effects for time and individual, but has a random individual effect for the coefficient on the independent variable. That is, I would like to estimate the model: Y_it = a_i + a_t + B_i * X_it + e_it Where i denotes individuals, t denotes time, X is my independent variable, and B (beta) is the
2018 Feb 11
1
Hausman test
you are right about the 3rd line but it doesn't help me for my problem. I remove the 3rd line but there is still the same problem: Error in solve.default (dvcov): the system is numerically unique: reciprocity condition value = 1.63418e-19 Paolo 2018-02-11 16:54 GMT+01:00 Bert Gunter <bgunter.4567 at gmail.com>: > Note the typo in your 3rd line: data < > > Don't
2006 Nov 23
1
how to loop this?
Hi, I have the next procedure: t1<-data.frame(table(substr(names(subset(lasker[[1]], lasker[[1]] >= 4)), 1, 7))) t1[1:5,] Var1 Freq 1 1988-02 3 2 1988-03 1 3 1988-04 1 4 1988-05 2 5 1988-06 3 How to make a new list?, dataframe? having 189 elements in the 'lasker' list: > str(lasker[[1]]) 'table' int [, 1:1274] 1 1 3 2 1 5 4 1 1 4 ... -
2010 May 24
1
Fixed Effects Estimations (in Panel Data)
dear readers---I struggled with how to do nice fixed-effects regressions in large economic samples for a while. Eventually, I realized that nlme is not really what I needed (too complex), and all I really wanted is the plm package. so, I thought I would share a quick example. ################ sample code to show fixed-effects models? in R # create a sample panel data set with firms and years
2005 Apr 29
2
Windows List of Folders?
For windows, how can I list only the folders in some folder? I was thinking that dir() and file.info() with isdir==TRUE being something that might work. These folders or directories are numerically named with no dot extension names or other characters. Typically, these are 3132, 3334, ... Here is what I tried. The last line is where I need more work. pData="C:/Myfiles/R/Data/" setwd
2006 Nov 26
1
adding elemens to a list
Hi, I have a list of 20 elements, each of them of variable length and with a structure like this: lasker[[1]][1:10,] Var1 Freq 1 1988-02 3 2 1988-03 1 3 1988-04 1 4 1988-05 2 5 1988-06 3 6 1988-07 1 7 1988-08 1 8 1988-09 1 9 1989-03 1 10 1989-04 1 How do I can insert in this list: 1988-01 0 1988-10 0 1988-11 0 1988-12 0 1989-01 0
2011 Jun 12
3
Running a GMM Estimation on dynamic Panel Model using plm-Package
Hello, although I searched for a solution related to my problem I didn?t find one, yet. My skills in R aren?t very large, however. For my Diploma thesis I need to run a GMM estimation on a dynamic panel model using the "pgmm" - function in the plm-Package. The model I want to estimate is: "Y(t) = Y(t-1) + X1(t) + X2(t) + X3(t)" . There are no "normal" instruments
2007 Aug 03
4
FW: Selecting undefined column of a data frame (was [BioC] read.phenoData vs read.AnnotatedDataFrame)
Hi all, What are current methods people use in R to identify mis-spelled column names when selecting columns from a data frame? Alice Johnson recently tackled this issue (see [BioC] posting below). Due to a mis-spelled column name ("FileName" instead of "Filename") which produced no warning, Alice spent a fair amount of time tracking down this bug. With my fumbling fingers
2008 Feb 27
2
problem with creation of eSet
Hi, I am having troubles with creating an eSet and would appreciate any help on the following problem. I am trying to create an eSet using the following code pd <- read.table(file="pdata.txt",header =TRUE,row.names=1); colnames(pd) <- c("type","tumor","time","id"); pdN <- list(type =