search for: country1

Displaying 8 results from an estimated 8 matches for "country1".

Did you mean: country
2012 Jun 24
2
Defining multiple variables in a loop
...the original data. Resample each variable and recombine into one matrix. plmcoef <- array(0, c(1000, 4)) #creates an empty array to store regression coefficients plmfixef <- array(0, c(1000, 3)) #creates an empty array to store fixed effects intercepts from regressions for (i in 1:1000) { country1 <- as.data.frame(subset(OECDFiscal2, Country == 1)) country2 <- as.data.frame(subset(OECDFiscal2, Country == 2)) country3 <- as.data.frame(subset(OECDFiscal2, Country == 3)) exp1 <- as.matrix(sample(country1$lagexpVSgdp, size = (nrow(country1)), replace = T)) exp2 <- as.matrix(sampl...
2012 Apr 22
10
Assignment problems
The text below is a part of, some work I have to do, which is due in 2 days and I am strung up with a lot of other stuff, so I was hoping someone would take 5 mins and help me ?? Here is a part of my data.frame: year country1 country2 contig comlang pop1 gdp1 pop2 gdp2 rta dist avgflow 1 1992 AUS AUT 0 0 17.4950008 321708.281 7.7825189 194684.078 0 15608.4 1.075999e+02 2 1992 AUS BEL 0 0 17.4950008 321708.281 10.0450001 231...
2010 Jul 20
2
loop through files and create object
Hi R users, I am a newbie and therefore the naive question. Sorry but I was unable to find an answer online. I would like to read 47 data sets (country1.raw, country2.raw, ... country47.raw) and save into a matrix each time (data1, data2, ....data47). for (i in 1:47){ data(?) <- read.csv(file.path("country", i, ".raw", fsep = ""), header = TRUE) } The read.cvs statement seems to be right, but how to include "...
2012 Apr 17
6
How to add specific column to data.set?
Hi I have a data.set with 7 lists, with over 7000 observations in each list. to of the lists contain country names. like: aus dnk fra aus usa aut itl usa . . . etc. My dilemma is that I want to add an extra column/list to my data.set. If the countries are both european it should be assigned 1 or true AND if one or both the countries are non-european it should be assigned 0 or false.
2010 Mar 30
2
Create a new variable
Dear R-list, Sorry for spamming the list lately, I am just learning the more advanced aspects of R! I have some data that looks like this: Out Country1 Country 2 Country 3 ... CountryN 1 1 1 1 1 0 1 1 0 1 1 1 0 1 0 I want to create a new variable that counts the number of zeros in every row whenever Out is equal to 1, and else it is a zero, so it would look like this: new_var 0 0 2 I have tried the following: for (i in length(Out)){ if (Ou...
2012 Oct 20
2
Help with programming a tricky algorithm
Hi All, I'm a little stumped by the following problem. I've got a dataset with the following structure: idxy ix iy country (other variables) 1 1 1 c1 x1 2 1 2 c1 x2 3 1 3 c1 x3 . . . . . 3739 55 67 c7 x3739 3740 55 68 c7 x3740 where ix and
2009 Dec 01
1
LMER: How to specify Random Effects
I saw different specifications for Random Effects and I'm confused about the use of "/" and the use of "(0+...|)" . Let say we have a nested structure where some countries have some several plants in different states and we measure the reaction to a drug. The list of Countries = USA, France, Italy The States for USA = Michigan, Florida, California The States for France
2006 Jun 18
13
Currency calculation
I''m thinking of experimenting with some currency conversion. However, I''d like the conversions to be in synch with the current rates. Anyone know (and this maybe out in left field) if there is some online (perhaps xml) or other data stream I can connect with in my code to output values based on user selection ? TIA Stuart