similar to: basic indexing

Displaying 20 results from an estimated 20000 matches similar to: "basic indexing"

2012 Sep 27
2
equivalent of Stata "by construct"
I am evaluating a switch from Stata to R. I don't need to extensive Statistical methods, but the main reason I am exploring the switch is the coding flexibility in R (e.g. Stata does not support linear/quadratic programming). I have been going over the R syntax and I had a quick question: In Stata, one has a very useful construction called "by", e.g. by month signal: gen xxx =
2009 Mar 26
1
pgmm (Blundell-Bond) sample needed
Dear R Experts--- Sorry for all the questions yesterday and today. I am trying to use Yves Croissant's pgmm function in the plm package with Blundell-Bond moments. I have read the Blundell-Bond paper, and want to run the simplest model first, d[i,t] = a*d[i,t-1] + fixed[i] + u[i,t] . no third conditioning variables yet. the full set of moment conditions recommended for system-GMM,
2011 Apr 07
1
Panel data - replicating Stata's xtpcse in R
Dear list, I am trying to replicate an econometrics study that was orginally done in Stata. (Blanton and Blanton. 2009. A Sectoral Analysis of Human Rights and FDI: Does Industry Type Matter? International Studies Quarterley 53 (2):469 - 493.) The model I try to replicate is in Stata given as xtpcse total_FDI lag_total ciri human_cap worker_rts polity_4 market income econ_growth log_trade
2004 Sep 22
3
loops: pasting indexes in variables names
I cannot figure out how, using R, I can paste indexes or characters to the variable names which are used within loops. I will explain this with a simple example: Immagine I have a huge series of variables, each one taken two times, say x1 x2 y1 y2 z1 z2..... Now, immagine that I want to compute a variable from the difference of each couple, say dx=x1-x2, dy=y1-y2, dz=z1-z2... In Stata, for
2002 May 16
1
foreign library - negative integers??
I am having a problem with the foreign library correctly reading some integer data. Specifically, d _ read.dta('aptaa.dta') > d[1:5,] scenario metcode yr ginv cons gocc abs dvac gmre gmer 1 1 AA 2002 0.007 1377 -0.071 51710 0.071 -0.011 -0.127 2 1 AA 2003 0.000 0 -0.016 62568 0.014 -0.043 -0.538 3 1 AA 2004 0.000 0 -0.002
2007 Mar 20
2
Any R function for self-controlled case series method /effect absorption?
Hello, Has anyone written R functions for applying self-controlled case series methods (http://statistics.open.ac.uk/sccs/). In fact only thing needed is to modify glm function to allow absorption of effect. Eg. in Poisson model individual effect is used as factor, but it is considered as nuisance term where parameter estimates are not needed. Could anyone point how absorbing individual
2012 Nov 30
2
Nombres de variables variables
Hola, ¿Como estas?, la siguiente tal vez sea una pregunta simple. Quiero crear nombres de variables pero que el nombre lleve el valor de un objeto. Ej: tengo estos dos valores x1<-10 x2<-20 Quiero crear las variables: var_10 <- var_20 <- Pero usando los objetos x1 y x2 como referencia. Solo como referencia, en stata esto lo hacia de la siguiente forma local x1 = 10 local x2 =
2003 Apr 24
1
pause during execution
I am trying to figure out how to pause the execution of a script and release the R command prompt to users and then continue execution of the script from the point it was stopped. This operation is analogous to the "pause" command in stata. If I remember correctly, insertion of a pause command in a stata script stopped script execution and allows users to manipulate objects that
2001 Jul 11
1
R for large data
I am trying to gain an understanding of R's capabilities in larger data set analysis. I really like R, but the datasets that I normally work with are in the 15m-50m range, sometimes much larger. The size owes to observations, not extraneous variables, so little can be done to "clean" the data of unnecessary elements. (i.e. database storage or external data manipulation doesn't
2010 Aug 04
2
does R have a command the same with Stata's loop command: ` '
hey, Rers in Stata therer is a loop command ` ' which could do the following: forvalue i=1/10 { ?gen?x`i'=expression } this will generate variable: x1,x2,,,,,x10. so, does R have a corresponding one to this? And one more very basic question: after I open a file and modify it, such as generate some new variables and change some old ones, how to use the changed dataset in
2011 Oct 09
2
variable name question
Hi All, This is surely an easy question but somehow I am not being able to get it. I am using R 2.13.2 and have a data set where variable names like this appear: pci1990, pci1991, ... , pci2009. "pci1990" has data on per capita income for 1990, "pci1991" has data on per capita income for 1991, and so on. I would like to create the logarithm of per capita for each of the
2009 Jan 20
2
Summing Select Columns of a Data Frame?
Hi, I would like to operate on certain columns in a dataframe, but not others. My data looks like this: x1 x2 x3 1 2 3 4 5 6 7 8 9 I want to create a new column named x4 that is the sum of x1 and x2, but NOT x3. I looked at colSums and apply, but those functions seem to use all the columns in a dataframe. How do I only use select columns? If it helps, in Stata this would be gen x4
2014 Jan 23
2
Stata support in package foreign
As you know, Stata support in 'foreign' was frozen a while back at Stata version 12. R-core has received a request from a grad student to 'give top priority' to supporting Stata 13. That is not going to happen, not least because none of us has access to Stata. However, according to Stata's documentation both Stata 12 and 13 use format 115, so foreign::read.dta should be
2001 Nov 20
0
Time series count model?
You may want to take a look at a paper by Julia Kelsall and Scott Zeger in JRSS(C) - 1999, pp. 331-344. This paper describes a frequency domain approach to log-linear regression modeling of poisson-distributed count data, accounting for correlation and over-dispersion. There are also some S functions available to implement the methodology. Ravi. -----Original Message----- From: pauljohn at
2009 Jun 29
2
Large Stata file Import in R
Hi I am using Stata 10 and I need to import a data set in stata 10 to R, I have saved the dataset in lower versions of Stata as well by using saveold command in Stata. My RAM is 4gb and the stata file is 600MB, I am getting an error message which says : "Error: cannot allocate vector of size 3.4 Mb In addition: There were 50 or more warnings (use warnings() to see the first 50)" Thus
2004 Jan 23
1
lags in regressions
Hi! I am trying to get R to run regressions for me of a variable on lagged differences of itself. Specifically: x-x(-1) = a + b1(x(-1)-rx(-2))+b2(x(-4)-rx(-5))+e I need to do this a lot of times, altering the value of r. What I've been trying to do was to use the lag() command to create lagged versions of these variables and then constructing these differences by hand (i.e. creating
2009 Dec 16
1
Stata files
I have a client who uses Stata 11. Can anyone advise me on ways of transferring data from this version of Stata to R? Reading the documentation for read.dta in package foreign it seems it only allows for versions up to Stata 10. I don't know Stata at all but a bit of poking around on their website led me to believe Stata 11 couldn't write in Stata 10 format. However Stata 11 can
2005 Jul 04
2
using index of a loop as a macro variable
Hi, I'm a long-time STATA user and a R newbie. I'm doing ok, but I'm addicted to STATA macro variables. Is there something like a macro variable in R? Specifically, I'd like to be able to do something like for (i in 1:3) { ..... x`i' <- ... } where R would resolve x`i' to the objects named x1, x2 and x3 as I move through the loop. I guess I could create these in
2008 Dec 22
2
AR(2) coefficient interpretation
I am a beginner in using R and I need help in the interpretation of AR result by R. I used 12 observations for my AR(2) model and it turned out the intercept showed 5.23 while first and second AR coefficients showed 0.40 and 0.46. It is because my raw data are in million so it seems the intercept is too small and it doesn't make sense. Did i make any mistake in my code? My code is as follows:
2000 Oct 19
2
weighting observations
Dear R users, I wonder how to weight observationswhen computing statistics and creating tables (e.g. of counts) I'm used to the SPSS paradigm (WEIGHT by foo.) where any subsequent command will weight any variable ... Suppose that I want to compute a table of weighted counts: is the right R-approach to write a little custom function or it could be better to write a new class