Quantcast
Channel: Statalist
Viewing all 65488 articles
Browse latest View live

How to replace inconsistent identity code with the majority identity within 6 years?

$
0
0
I have 140,000 firms for 2010-2015. I want to check whether the industrial code (indcode) is consistent or not within 2010-2015. If a firm produces the same product within 6 years, then indcode must be identical for 6 years. But in some case, the indcode is not identical even though the firm produce a same product during 6 years . For this inconsistent industrial code I have to edit with the majority indcode during six years. I did with the following command to identify incosistent indcode then I edit manually:

Code:
by firmcode: gen nyear=[_N]
by firmcode, sort: check2 = total(indcode)
gen check2=check1/indcode
edit year firmcode indcode nyear check1 check2 if check2!=nyear
As a result, I have to correct the industrial code of 17,844 firms manually by seeing their historical data and type of product. It is time consuming. I am wondering if I can edit with STATA command, not manually. Can you please share the STATA command how to replace inconsistent industrial code with the majority indcode within 6 years?

Seeking a way to examine the sensitivity of one variable with respect to another (both a time series)

$
0
0
Hi, this maybe a very rookie question, but many thanks for any help.
I have a data like this
State Year Cyclical Loan
AL 1996 -0.1 20000
AL 1997 -0.2 30000
AK 1996 -0.16 22733
AK 1997 0.13 33333
IL 1996 0.05 23342
IL 1997 -0.01 12330
.....
Of course, this is just an example and the actual data has many years.
My goal is to examine the sensitivity of Loan to Cyclical for each state, but the problem is,
I don't actually know what the sensitivity here typically referring to, I talked with my classmates they just think
it means how much Loan changes with 1 unit change of Cyclical, but other than that, no one seems to have a very good
model or specific method to analyze this, please enlighten me what is the "right" way to examine the sensitivity for this data?

Panel data - dropping all observations after a switch

$
0
0
Hi everyone,

I have panel data below (just one id shown), it is sorted by id and date
I want to be able to drop all observations once the type is different from above - i.e. I only want to keep the observations below nn<=45
How can I code this so that the order of 1 or 2 doesn't matter (some id have first type as 2, some have first type as 1 - I want to keep only the observations where the first type occurs but none after they switch, even if they switch back)

any help would be appreciated

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long id int date byte type float nn
165618 16819 1   1
165618 16845 1   2
165618 16867 1   3
165618 16887 1   4
165618 16897 1   5
165618 16918 1   6
165618 16940 1   7
165618 16965 1   8
165618 16987 1   9
165618 17010 1  10
165618 17034 1  11
165618 17058 1  12
165618 17080 1  13
165618 17106 1  14
165618 17129 1  15
165618 17153 1  16
165618 17177 1  17
165618 17199 1  18
165618 17221 1  19
165618 17245 1  20
165618 17274 1  21
165618 17303 1  22
165618 17331 1  23
165618 17359 1  24
165618 17386 1  25
165618 17421 1  26
165618 17456 1  27
165618 17485 1  28
165618 17513 1  29
165618 17539 1  30
165618 17567 1  31
165618 17594 1  32
165618 17619 1  33
165618 17645 1  34
165618 17671 1  35
165618 17696 1  36
165618 17723 1  37
165618 17748 1  38
165618 17772 1  39
165618 17797 1  40
165618 17806 1  41
165618 17811 1  42
165618 17834 1  43
165618 17868 1  44
165618 17902 1  45
165618 17918 2  46
165618 17930 2  47
165618 17930 1  48
165618 17958 2  49
165618 17958 1  50
165618 17986 1  51
165618 18014 2  52
165618 18014 1  53
165618 18028 2  54
165618 18031 2  55
165618 18039 2  56
165618 18056 2  57
165618 18057 1  58
165618 18070 2  59
165618 18084 2  60
165618 18088 1  61
165618 18088 2  62
165618 18088 1  63
165618 18100 2  64
165618 18100 1  65
165618 18129 2  66
165618 18129 1  67
165618 18161 1  68
165618 18161 2  69
165618 18189 1  70
165618 18189 2  71
165618 18213 1  72
165618 18213 2  73
165618 18241 2  74
165618 18241 1  75
165618 18274 2  76
165618 18274 1  77
165618 18274 1  78
165618 18274 2  79
165618 18302 1  80
165618 18302 2  81
165618 18329 1  82
165618 18329 2  83
165618 18351 1  84
165618 18351 2  85
165618 18381 2  86
165618 18381 1  87
165618 18415 1  88
165618 18415 2  89
165618 18441 2  90
165618 18441 1  91
165618 18465 2  92
165618 18465 1  93
165618 18492 1  94
165618 18519 1  95
165618 18553 1  96
165618 18561 1  97
165618 18577 1  98
165618 18605 1  99
165618 18631 1 100
end
format %tdnn/dd/CCYY date

Name variable

$
0
0
Hello,

I have a dataset with a variable called "Country". I would like to know the code to know the name of the countries included in this variable?
Thank you in advance.

Creating a dummy based on a combination

$
0
0
Hi all,

I am trying to create a dummy variable based on the particular combination of two other dummy variables.
Based on the example data set below, I have created a group id called as 'idtemp' based on the combination of three variables - state, year and const. The variable called 'order' explains the rank of the individual, therefore if order=1, he/she is the winner and if order=2, the individual is the loser. With each id('idtemp'), there is only one winner and one loser.

Now, I would like to create a dummy variable within each id, based on the following set of combinations. Let's call the dummy variable I intend to create as 'temp' and I want temp=1 for the following two set of combinations within each id.

1. "within each id", if the dummy1=1 for the winner(order=1) and dummy2=1 for the loser(order=2), then I want temp=1, and
2. "within each id", if the dummy1=1 for the loser(order=2) and dummy2=1 for the winner(order=1), then also I would like to set temp=1.

Therefore in the example dataset below, the variable 'temp' takes on 1, for the idtemp values of 3, 4 and 15, as the required condition has been satisfied. And for all other ids the variable 'temp' has been set as zero

Any suggestions would be helpful.

Regards

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str17 state float year str29 const float(order idtemp dummy1 dummy2 temp)
"Andhra Pradesh" 1994 "Achampet"   1  1 0 1 0
"Andhra Pradesh" 1994 "Achampet"   2  1 0 1 0
"Andhra Pradesh" 1994 "Achanta"    1  2 0 0 0
"Andhra Pradesh" 1994 "Achanta"    2  2 0 1 0
"Andhra Pradesh" 1994 "Addanki"    1  3 1 0 1
"Andhra Pradesh" 1994 "Addanki"    2  3 0 1 1
"Andhra Pradesh" 1994 "Adilabad"   1  4 0 1 1
"Andhra Pradesh" 1994 "Adilabad"   2  4 1 0 1
"Andhra Pradesh" 1994 "Adoni"      1  5 0 1 0
"Andhra Pradesh" 1994 "Adoni"      2  5 0 1 0
"Andhra Pradesh" 1994 "Alair"      1  6 0 1 0
"Andhra Pradesh" 1994 "Alair"      2  6 0 1 0
"Andhra Pradesh" 1994 "Alampur"    1  7 0 1 0
"Andhra Pradesh" 1994 "Alampur"    2  7 0 1 0
"Andhra Pradesh" 1994 "Alamuru"    1  8 0 1 0
"Andhra Pradesh" 1994 "Alamuru"    2  8 0 1 0
"Andhra Pradesh" 1994 "Allagadda"  1  9 0 1 0
"Andhra Pradesh" 1994 "Allagadda"  2  9 0 1 0
"Andhra Pradesh" 1994 "Amarchinta" 1 15 0 1 1
"Andhra Pradesh" 1994 "Amarchinta" 2 15 1 0 1
end



MRS/WTP estimation with effects-coded mixlogit

$
0
0
Hi, does anyone have advice on using effects-coded model for MRS/WTP estimation in DCE.

Assuming I have a continuous price variable (price) and a categorical car model variable with 3 categories (car1, car2 , car3 )

In a dummy coded mixlogit model (with X3 being the reference), I would use the nlcom command "nlcom (_b[car2])/(_b[lprice])" to estimate the MRS for car2 compared to car3.

However, if I have to run an effects coded model, how can i estimate the MRS of car 1 vs car3? Say car 3 is the omitted variable whose coefficient from the mixlogit is derived from the negative sum of car1 and car2.

Would the command then be "nlcom (_b[car1]-(-(_b[car1]+_b[car2])))/(_b[lprice])"?

Thanks!

Margins saving error

$
0
0
Hi Statalist,

I'm having trouble saving a margins dataset after running a non-parametric regression and I'm struggling to see where my mistake is.

After opening my dataset, my exact code is:

Code:
npregress kernel std_dev n if c5==1 & year==2018, vce(bootstrap, reps(100) seed(100))
margins, at(n=(1(1)32)), saving (marginsus)
Stata returns with:

Code:
invalid 'saving'
r(198);
How can I resolve this issue?

Merging monthly and yearly data for respective last 12months

$
0
0
Hello,

I have two data sets which I want to merge. In the first dataset A ,I do have the following variables: id, year, month (and further variables which are not of interest in this case.)
In the second dataset B, I have the variables: id, year, month, costs.

My problem is the following: The costs in dataset B refer to the average costs over the last 12 months and are reported for each id only once a year, but at different months. For one id they are reported yearly in september, for another id they are reported yearly in december etc.

If I now match the datasets using the following code
Code:
merge m:m id year using "B"
the costs are matched on a yearly basis. Meaning costs reported in September2018 for a given id are merged with each month in 2018. But I want every value for costs from dataset B to be merged with the respective last 12 months in dataset A. In this case that means that costs reported in September 2018 are matched with the months October 2017-September2018.

I did search in the forum but did not find any solutions.

Does anyone have an idea how to solve this?

Thank you for your help

Tim Wolf

Grouping individual years into year groups in panel data

$
0
0
Hello
I have data for more than 1000 municipalities in Colombia, and for each, 20 years of observations. I was wondering how I could group the years. I mean, instead of having 1990, 1991, 1992... 2018 to have 1990-1992, 1993-1995, 1996-1998 and so on. Then I want to add the values of the variables in each group of years. The code I am using is

gen group=.
replace group=19901992 if year>=1990 & year<=1992
replace group=19931995 if year>=1993 & year<=1995
replace group=19951998 if year>=1996 & year<=1998
replace group=19982001 if year>=1990 & year<=2001
bysort group: egen sum_var=sum(var)

for each of the variables, but in the end i get all my results the same rather than grouped by each year group.

Thank you

T Dimension Requirements With xtscc

$
0
0
Hi Dear,

According to my recent reading, xtscc relies on large T asymptotics. My question is how large T should be for it to be reliable?

Is there any consensus among researchers for a minimum requirement of T for its applicability?

Thank you.

Individuals within countries panel data

$
0
0
Good morning fellow statalisters. I just have a quick question:

I currently have a dataset with multiple observations (individual responses) for multiple countries in multiple years. Now, when trying to xtset it I receive the r(451) error code which I expect given that I have repeating values of country/time. However, what I am trying to achieve is a panel data specification for individuals in a given country at time t. Would anyone be able to offer any assistance regarding how I'd go about attaining such a specification. I've tried collapsing the data set however for variables such as gender that don't vary over time this computes an mean of each of these for each country...

Thanks in advance!

erase file error when confirm file and save file work

$
0
0
Trying to confirm whether a file exists, and erase it if it does exist. Can't seem to figure out how to do this with a Windows path with spaces. Here's my MWE:

Code:
webuse auto
local pathname `c(pwd)'
save "`pathname'\erasetest.dta", replace
confirm file "`pathname'\erasetest.dta"
erase file "`pathname'\erasetest.dta"
The erase command produces this error
Code:
invalid '"C:[path]\erasetest.dta'

Including lags in a xtreg regression

$
0
0
Hello,

I have a panel dataset containing quarterly data from 2000-2016. I want to do a regression where my dependent variables are lagged 8 periods, but I do not know how to do that correctly so I was wondering if anyone can help me?

I am doing an OLS regression using the xtreg-command.

Thanks in advance.







mhodds and test for trend

$
0
0
Dear Listers,

I am considering using the -mhodds- command for an expvar with more than 2 levels in Stata 15. The help file states that in this case, -mhodds- calculates a 1-degree-of-freedom test for trend.

Is this the same as (or equivalent to) the Cochrane-Armitage test for trend? I am asking as the study was powered for a trend analysis using the -power- command which uses the Cochrane Armitage test.

Thanks,
Laura

Error in finding host for ssc package download

$
0
0
Hi all,

I'm currently working on my thesis with the Abadie-Imbens estimator and have been using Stata 14.2 to do so. To use this estimator a package is available on ssc called nnmatch. For the last three days I was able to download the package without any issue with the
Code:
ssc install nnmatch
command, but for some reason I know get following error.

Array









I don't know what is occurring, as I am executing the exact same .do file as yesterday, which worked. Does anyone have any ideas?

Kind regards,
Samuel

Choosing reference/base periods in panel data and normalizing the corresponding coefficient to zero

$
0
0
Hi

I am looking to do two things with a panel dataset (c350 firms and annual data from 2008 to 2016).

1. I would like to set 2011 as the base period for the variable i.Year in the following regression and normalize the corresponding coefficient to zero:

Code:
xtreg inv i.Year i.company, fe cluster(company)
I am interested in the coefficients on the year dummy variables above.


2. I would like to set the omitted variable below to 2011 for the Year variable so as to include coefficients for (2008*eba), (2009*eba), (2010*eba), (2012*eba), (2013*eba) etc - but not (2011*eba). The dummy variable eba takes the value 1 or 2 and the year variable takes values from 2008 to 2016.

Code:
xtreg inv i.Year i.comp eba#i.Year, fe cluster(comp)

I have seen other posts looking at setting reference periods, but none of the posted solutions seemed to work on my data, so I was wondering if the solution was different.

Any advice would be very much appreciated,
Thanks
Paul

Regression with change relative to base year

$
0
0
Hello!
I am sorry if this topic came up before, I tried searching for answers but without luck. I have panel data for N=11 over 2006-2017 and I am trying to estimate whether a greater share of "routine occupations" in the base year (2006) had led to greater computer adoption.
I was thinking of regression using re as that's was Hausman test suggested:
Code:
xtset industry time
xtreg computer_adoption L10.routine, re robust
My question is whether this specification is correct or would that give me an estimation for something different that I look for?

How to deal with circular causality

$
0
0
This is a statistics question rather than a Stata question. But I figured I'd ask anyway, since the experts are here.

Often in time series and panels, the "dependent" and "causal" variable don't share purely that relationship. There is a fair bit of reverse causality as well. ,e.g.
x causes y, but then either y causes x directly or y causes z which causes x, and you have a whole cycle going....

What are some of the ways to deal with this sort of an issue? How does one choose among these methods (if such a choice needs to be made) based on one's data?

Installing sae

$
0
0
Can someone help with the instalation of sae. When I use the usual .SSC install...' I get the following message

ssc install sae
connection timed out -- see help r(2) for troubleshooting
http://fmwww.bc.edu/repec/bocode/s/ either
1) is not a valid URL, or
2) could not be contacted, or
3) is not a Stata download site (has no stata.toc file).

Reshaping Dataset to long format

$
0
0
Dear STATA forum,

I am currently working with time series data, which looks as follows:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str9 A str18(C D E F H I J N AV GZ)
"group"     "1"                  "1"                  "1"                  "1"                  "1"                  "1"                  "1"                  "1"                  "3"                  "6"                 
"series"    "PCECC96"            "PCDGx"              "PCESVx"             "PCNDx"              "FPIx"               "Y033RC1Q027SBEAx"   "PNFIx"              "A823RL1Q225SBEA"    "USLAH"              "CPIAPPSL"          
"01oct1959" ".3650269129167977"  ".216028379993192"   "1.179607709471712"  "-.2967423205396629" ".0495683544804948"  ".6394198594864074"  ".7376720827380208"  ".5515294829904713"  "-.2028341548527938" ".4274368075580418" 
"01jan1960" "-1.038272296385466" "-2.1248980673514"   ".8717495172530111"  ".0286256548641881"  "-1.00154327243243"  "-.5419068647278947" "-.7082569079974281" "-.8071674360430571" "-.1034524944867727" "-.6157613669459645"
"01apr1960" ".2330519053439989"  ".6462049897425028"  ".2170887836461679"  "-.488438864473532"  "1.10563026070154"   ".7140166687668444"  "1.111214670973889"  "-2.311960797983416" ".9112059543879397"  ".1152341626848988" 
"01jul1960" ".6894363614418856"  ".3311574486157206"  ".6445833730489374"  ".7052953694152898"  "-1.317474119359146" ".1077035370398261"  ".1432600855863257"  "-.1059045100902682" ".7672618455065779"  ".3209967556727604" 
"01oct1960" "-1.815167574724039" "-.7182466608899543" "-2.010713804545575" "-1.681672688885647" "-1.474786397559528" "-2.001673458551451" "-1.439875396154446" "1.647252804791704"  "-1.942275301868003" "-.1968986016941461"
"01jan1961" "-1.012717500919827" "-1.31699927459115"  ".3440066616958974"  "-.7468123683105136" "-.5439891800339417" "-1.711734072929461" "-.686485749690427"  "-.0036370000554865" "-1.343913507751506" "-.1940148721752263"
"01apr1961" "-1.265030523659988" "-2.385659931921413" ".3818564291751042"  ".0017701771616262"  "-.852752046639895"  "-1.619007477152278" "-1.278199415199424" "-.0474659329275358" "-1.447116222993477" "-.0904296547895576"
"01jul1961" "1.028181956482924"  ".2635462626236992"  "1.395624122178266"  "1.047319935244806"  ".320390512806864"   "1.149376185431282"  ".5150877214902447"  ".2885558857581755"  "-1.447489192686121" "-.2946968534090217"
"01oct1961" "-.4741309717936375" ".386784411896169"   "-1.090030243182865" "-.7327062177342363" ".6740182985056374"  "-.0027749604162845" "-.0916161881577133" "1.603423871919655"  "-.0916305019058138" ".6254159245173585" 
"01jan1962" "1.806877163511684"  "1.184793236978319"  "2.084363705545158"  "1.073205459692264"  "1.023205479575812"  "1.553996781663094"  ".9053877652513282"  ".8875513016761827"  "-.0133912208794087" "-.4983635406068285"
"01apr1962" ".3868891877851496"  ".2951560576894264"  ".274277039405609"   ".3271455521052388"  ".4474998613964707"  ".4094108092063287"  ".4039526081671853"  "2.05632284493083"   ".0632629931201929"  "-.089538963428239" 
"01jul1962" ".6415112640529802"  ".4690597982810318"  "1.501809979182293"  "-.2810237129128761" ".8741803317765729"  ".3949598143762736"  ".7443037232352402"  "-.0036370000554865" ".6399187051039077"  ".5219950427953112" 
"01oct1962" ".006811979715034"   "-.1923909169116167" ".0782071631553874"  ".2550478480296683"  "-.0685263180852191" "-.3477472084749097" ".0347941242230708"  "1.588814227628971"  "-.6227203074822057" ".1128955788980066" 
"01jan1963" ".918796140849536"   "1.038266785708293"  ".9696831591242979"  "-.050460291815162"  "-.5928637444044654" "-.3687737690927571" "-.7541435508185592" ".0401919328165628"  "-.2432983148115164" "-.0907155024708925"
"01apr1963" "-.1516759755249011" ".2355007054356036"  "-.7883935713899857" "-.0635079564150938" ".1651988841451537"  ".1628581060821312"  "-.4546943747951009" "-2.122035422204536" "-.3306680589379105" ".0115499511787685" 
"01jul1963" ".2134739499711086"  ".2871131404648894"  ".571081293208995"   "-.3612698975652616" "1.614521979741091"  ".2188935600813344"  ".936591227504702"   "-.500364905938712"  ".0256149179170723"  "-.0895414987890042"
"01oct1963" ".8317360486024667"  "-.0199021398544998" "2.002772276961568"  ".4465403993343057"  ".7029652784007221"  ".991078706458812"   ".7637052394371432"  "3.356581186801627"  "-.3731621487491961" ".3126809887864598" 
"01jan1964" ".0478190578910472"  ".0960184847336646"  "1.21071907016694"   "-1.01904394343553"  ".9440259887086854"  ".8606822927965568"  ".8447592453595382"  "-1.698355737774726" ".5127837598584295"  ".009845829389005"  
"01apr1964" "1.734484676308298"  ".8715861062185633"  "1.679390069354753"  "1.569098013124387"  "1.159399885538991"  ".3693331801199505"  ".4525099186872378"  "-.5149745502293951" "1.087076251817215"  "-.4878775389230119"
"01jul1964" "1.446477024834592"  ".4446847066132618"  "1.282686653509209"  "1.844521635032474"  "-.5393184637666767" ".2322778950027193"  ".5678956526158467"  "-.2666105972877823" "-.553470309218246"  ".2115636157630214" 
"01oct1964" "1.562889776954102"  ".676627587111945"   "1.131892921737746"  "1.906727747972031"  ".3147533656718683"  ".7342085325944484"  ".9888539513331548"  "-.5588034831014443" "1.254048938168931"  "-.1870323913065357"
"01jan1965" "-.7770969052705949" "-1.512988072012822" "1.237467593479263"  "-.577513115129842"  "-.0420592696057363" ".5395446741052972"  ".4673248258159708"  "-.7195095702989585" ".5865187771549574"  "-.1863130301950011"
"01apr1965" "2.131083902041099"  "2.617426787299745"  ".7309426724653341"  ".5018898669430844"  "1.639655162214056"  "2.074808779755221"  "2.468141660842969"  "-.7341192145896416" ".9982615118277749"  ".7074707059182995" 
"01jul1965" ".4522377815342461"  "-.3861478642061674" "1.507098135413732"  ".5019955740155905"  ".8709896854955697"  ".1437179600054622"  "1.206219911443775"  "-.1351237986716344" "1.440077419291179"  ".0099029943509844" 
"01oct1965" "1.37106724902054"   ".7130208792045011"  "1.204024814876736"  "1.269573881784313"  ".8165434055988159"  "1.336796475698952"  "1.187412281521526"  "2.05632284493083"   ".4475461626601492"  "-.3835162829439308"
"01jan1966" "2.989559538698568"  ".9755940543694648"  "1.911106426111434"  "4.343103097214621"  ".6380121136528563"  ".848947890937317"   "1.392360098672"     "1.106695966036429"  ".8469757071329148"  ".5030020009062299" 
"01apr1966" "1.010392879788524"  "1.152529911690924"  ".4960274302606272"  ".186832598733116"   "1.289319920882488"  "1.382549797151781"  "1.44983096526942"   "1.194353831780528"  ".7801054978809909"  ".4961709288873585" 
"01jul1966" "-.8211857268176199" "-1.84379319854661"  ".601560502201531"   ".503121641633439"   "-.910830461575513"  ".7260860775254138"  ".2311688098935802"  "1.428108140431458"  ".9175377526388033"  ".0027627196066633" 
"01oct1966" ".5106353127449059"  ".6656517350270938"  ".0356526806521705"  ".179766877490417"   "-.3985568731896644" "-.3156039778678864" ".0755440531090297"  "2.173199999256295"  ".7071912634993399"  ".002920162991501"  
"01jan1967" "-.5791697797795964" "-.4558543252893984" ".6171421861578836"  "-1.238126008190143" "-1.72427282643924"  ".0198845843913048"  "-.57176557915812"   ".4346523286650065"  ".0496198962768041"  ".3819912846722675" 
"01apr1967" "-.3386850516552029" "-1.099549109043046" ".2316462310028997"  ".7448987096619081"  "-1.361394058758344" "-1.874069947371308" "-1.375557844725085" "3.926357314138268"  ".1115271975070307"  "-.0035481845483056"
"01jul1967" ".8474874681438693"  "1.004043927394374"  ".352743319242739"   ".210891961116713"   ".7004424481280962"  "-.0989744263116114" "-.6885150345524041" "-.8656060132057894" "-.1779062157443193" "-.1892627531632378"
"01oct1967" "-.4353933021056668" "-.7196139345991366" "1.203293342446026"  "-.9778154193568774" ".1136653272159302"  "-.9489007958514641" "-.6555273792031289" ".7560645030600347"  ".8997718998462967"  ".0925326184720688" 
"01jan1968" "-.2848750319926338" "-.3564450751428609" ".0551590824458298"  "-.2105289986939464" ".9495473651720563"  ".6131805300437472"  ".4100271262045093"  "-.2081720201250499" ".8344798876664551"  "-.1829120923509563"
"01apr1968" "2.377398164886389"  "1.62804917321992"   "1.657457968146071"  "1.920649269446877"  ".5972545558494186"  ".8212479092290407"  ".8580470248144195"  ".8145030802227672"  ".160723677526873"   ".8128165713928067" 
"01jul1968" "1.079740584848722"  ".2821693962910181"  "1.605232000885171"  ".8937829965454899"  "-.5650322287390143" "-1.32088652424397"  "-1.178739070306428" "-.5588034831014443" "1.051826140701213"  ".3387707627336444" 
"01oct1968" "1.603033303706275"  "1.070251999025629"  ".998264815363752"   "1.40273801223266"   ".2813449011693839"  ".3740777848710688"  ".1000339391653166"  "-.5734131273921275" ".9577020884451108"  ".1486124887732554" 
"01jan1969" "-.5272002841166726" "-.6443923088454776" ".6243123416037663"  "-.8118660068894953" ".6569976525854296"  ".7126586090114193"  ".753617796958466"   "-.5149745502293951" "1.141599463101798"  "-.4567273567037548"
"01apr1969" ".4610824734080385"  ".2025424060886231"  ".1441311774111799"  ".7267020481666029"  ".8519003487361485"  ".7705209551326886"  ".673700915840778"   "-.4273166844852964" ".9176294007787368"  "-.0996980345353093"
"01jul1969" "-.2350112605413687" "-.5326506502741893" ".9252422328742473"  "-.5297375285797549" "-.1968620366422049" "-.1102662798693819" "-.0371399026584756" "-.9532638789498882" "1.04629082591348"   "-.0120660507931358"
"01oct1969" "-.47225354082037"   "-.5377877348121621" ".0053378901315474"  "-.3079743067825998" ".2275460680295671"  "-.0202342997893399" ".5366314303612599"  "-.1205141543809513" ".5892434617963037"  "-.0936977087241521"
"01jan1970" "-.0032792055477978" "-.5716599444605845" ".9407424907406815"  ".104701003639077"   "-1.512352801123821" "-.7584701720683181" "-.8298496045736499" "-1.523040006286529" ".4840116688228455"  "-.0087888282934416"
"01apr1970" "-.2720469868260188" "-.9710421678446456" ".5927833929733638"  ".3647797811251412"  "-.6855475465188937" "-.713278551584367"  "-.9183033725431918" "-1.201627831891501" ".0336102910615345"  "-.3301642028694415"
"01jul1970" "-.5242973035531585" "-.0456596474901753" "-.4143356944684061" "-.9356064229984965" "-1.431804872683593" "-.6182129337048297" "-.8941855461632832" "-1.712965382065409" "-.8540310860896672" "-.3206456301386363"
"01oct1970" ".1130394350764603"  "-.3166481963767204" ".7056055420840501"  ".1784443672558487"  ".342009018793706"   "-.2607288937203627" "-.3977870366682341" "-.9386542346592049" "-.9662232963340528" ".163547915715044"  
"01jan1971" "-1.620372641016939" "-2.806421990614395" "-.6470521465175489" ".8083289355668566"  "-.4668052812522925" "-2.354356236683905" "-2.288908186865287" "-.4565359730666627" "-.249668639517186"  ".5520361986297447" 
"01apr1971" "1.670423139635876"  "3.057171010330006"  "-.2442254642831571" "-.2567152059191636" ".5047210399082925"  ".1047316214498423"  "-.1669373729709459" "-2.019767912169754" ".3333711798156014"  "-.6295336343876677"
"01jul1971" ".1766471061234129"  ".328580366379263"   ".4305477080731884"  "-.5231170924482551" "1.288192598270015"  ".3573821591135765"  ".0951695994286574"  "-.9094349460778387" ".1991594926212338"  ".0042487470070704" 
"01oct1971" "-.0062275272890239" ".458963855892864"   ".2862249437969455"  "-1.137983533238788" ".356462975897121"   "-.2350413475463347" "-.3548476895206762" "-.4857552616480288" ".3208172671420973"  "-.5329716999562912"
"01jan1972" "1.283207030474974"  ".9944291271265092"  "1.629153428624294"  ".112844980818614"   ".777423165427256"   ".7028015808631489"  ".4261241764055114"  "-1.712965382065409" ".1171145059790657"  ".0870517630456919" 
"01apr1972" ".7767700902324838"  ".3354374728116997"  "1.891200713436481"  "-.3909748807505453" "1.52944011588873"   ".8205781082190974"  ".9726948505182386"  ".2593365971768093"  "1.195143106558721"  ".1618984113998823" 
"01jul1972" "1.646850410716824"  ".4101759947300904"  ".8707110933541035"  "2.947821535784159"  ".3590930272541478"  ".3104159241267031"  ".2267761205245234"  ".3469944629209079"  ".7094722374663045"  ".0085309203833936" 
"01oct1972" "1.107098376934679"  ".428906811726049"   "1.169968774714156"  "1.102529243346497"  ".0862688121727292"  ".3491821503505885"  ".1457181297067658"  "-2.735640482413226" ".3892030318764719"  "-.5956212307372077"
"01jan1973" "2.303708941197178"  "1.329887898843835"  "2.112543555506042"  "1.823244162087189"  "1.579431099813009"  "2.083859178533785"  "1.732474618836299"  "-.0912948657995851" "1.403416287723386"  "1.58993907073789"  
"01apr1973" "1.53101542837176"   "1.678008824561743"  "1.02778367370448"   ".0229406917459784"  "1.371310240339713"  "1.381416525345491"  "1.450809448449703"  ".5369198386997882"  "1.186470222790553"  "-.674284269067897" 
"01jul1973" "-1.277001348923534" "-.8466701601345611" ".0950556388602271"  "-2.040821312239445" "-.085368639194806"  "1.092025439211075"  "1.226361806161377"  "-1.157798899019451" ".2098403366955086"  "1.031406574006964" 
"01oct1973" "-.6766793245606977" "-.7415853243807145" "-.3224879317244568" "-.1685016711512946" "-.5759462618288635" "-.0447442022278105" ".182506062725836"   "-2.195083643657952" "-.4328741765887915" "-.9567068655553999"
"01jan1974" "-1.661023845133604" "-1.241584833852614" "-.9636949670514554" "-1.397441208155819" "-.8392736192470789" ".0903083792960127"  "-.2021801217358961" "-.1059045100902682" ".7541151064454259"  ".6501686904352436" 
"01apr1974" "-2.569592588775919" "-1.239026180608115" "-2.165118154907983" "-2.753448016116959" "-1.374649935199472" "-.4308659939187616" "-.6214844120597705" "1.223573120361894"  "-.8165074396295986" ".9083992969347736" 
"01jul1974" "-.6644845282829209" "-.2507623629004352" ".4167222245443467"  "-1.788179136868962" "-1.031721724343024" "-.5267158040195421" "-.6553749974370949" "-.4419263287759795" ".218774528250172"   "1.064906326537202" 
"01oct1974" "-.559644869010042"  "-.2487190006498987" "-.6080650292517027" "-.5428510623056731" "-1.23484671063808"  "-.3038710377590775" "-1.075596335520697" ".1424594428513445"  ".0242134395579938"  "-.147925126466206" 
"01jan1975" "-3.438485104267311" "-3.895517472196093" ".4662871678029365"  "-3.42641862570866"  "-3.079730577865029" "-1.913883678803197" "-1.881793374747921" ".3469944629209079"  "-.8119415197265335" "-1.317534991653828"
"01apr1975" ".0560660247270305"  ".2551710630258799"  ".2767376034572848"  "-.5980737827738064" "-3.245375704986546" "-3.099794343899408" "-3.462417069001491" "-.8363867246244232" "-2.043020519386357" "-1.322677650130021"
"01jul1975" "1.261786605897996"  ".2012116200195923"  ".8365990298976342"  "2.257661064189784"  "-1.014745136578465" "-1.207446393983069" "-1.768005708778405" "-.8071674360430571" "-.6489150084463926" "-.4485852148798758"
"01oct1975" ".9282735592420885"  "1.632092038517535"  "-.7237562008349547" ".5294154789421791"  ".6788605719482625"  "-.0494150897670128" "-.0488707292775101" "1.325840630396675"  "1.159314876273739"  ".5304822528047869" 
"01jan1976" ".410925863931661"   ".5460136144076979"  "1.356936226627442"  "-1.189224706004883" ".4817820039283792"  ".0357309035571498"  ".0132287507480207"  "-.0474659329275358" ".2959375838937844"  ".1997759802784533" 
"01apr1976" "1.789012314248477"  "1.247653409270552"  ".7701128752680693"  "2.016660397233809"  "1.447507251290077"  "-.0260520797032605" ".4726903602541866"  "-.8071674360430571" "1.723983433107468"  ".3862055121369274" 
"01jul1976" ".1781129182920684"  "-.2786472943221697" "-.3084927620379828" "1.328835186486286"  ".3264138483658793"  ".1736312488602135"  ".0787406637737185"  "-.4419263287759795" ".8774233770177078"  "-.2550004762766421"
"01oct1976" ".3772494396542608"  "-.0479463001314934" ".8662612015822179"  ".2427014506601045"  ".0823693167748556"  ".4605426245670524"  ".4941195024734969"  "-.1497334429623175" ".1922189514120525"  ".9374208911870856" 
"01jan1977" ".7433811881985081"  ".0983993067739098"  "1.213658069790677"  ".6456312165139634"  "1.745153938003718"  ".4901409350874407"  ".3714440489460375"  "-.1059045100902682" ".0095021831818363"  "-.6941627432223206"
"01apr1977" ".5656950418357291"  ".8283949453597093"  ".914090364955625"   "-.9387556318845575" "1.154202524273226"  "1.685458569449965"  "1.190952951400212"  ".1716787314327107"  "1.044648546249621"  ".3023085235490867" 
"01jul1977" "-.3898342487475266" ".3585867896362712"  "-.9499821719277439" "-.859684628683116"  "1.94868628397752"   ".4003644633359048"  ".7715859730042768"  ".5223101944091051"  "1.313064970298759"  "-.5494290839001158"
"01oct1977" ".2163788627599916"  ".0579986470869157"  ".5600417201379527"  "-.1433342187743993" ".1461079211411683"  ".3775206461461043"  ".4016333789366486"  ".3616041072115909"  "1.258935484584246"  ".7781081487126212" 
"01jan1978" "1.051087923229957"  ".2702198453418733"  ".3024906424603198"  "2.177847361704409"  ".3522365645949304"  "1.132235060525176"  ".9050107348011314"  "-.6318517045548598" "1.522962085688418"  "-.8370348630842486"
"01apr1978" "-.3603944008469778" "-1.368915459630079" "1.619634149176558"  "-.2406078235347345" "-.0325077351943085" ".0189497317913096"  "-.1410818137378572" "-.1935623758343668" "1.076003193364377"  "-.8770610772120535"
"01jul1978" "1.994452586564669"  "2.029065865419627"  "1.493190675254634"  ".2421106102103471"  "2.677499039981866"  "2.149827523096719"  "3.102361465366324"  ".9313802345482319"  "1.607117858307983"  "2.231947075388632" 
"01oct1978" "-.5742037512978059" "-.9068000128614087" "-.1890450533822254" ".2485174118483756"  ".81918751196242"    ".1980122028522099"  "1.072090841706122"  ".1424594428513445"  "1.077282315624789"  "-1.517410660881206"
"01jan1979" ".0082990718208445"  "-.1681939652244558" "-.6073324403980389" ".9767019984133855"  ".5841425435978528"  ".4483184447885399"  ".994419957599628"   ".2593365971768093"  ".7398414043699102"  ".5784172817392919" 
"01apr1979" "-.4264559898412105" "-.844940410121049"  ".5128568837998314"  "-.2246224227064483" "-.0185981641920819" ".7559261720306359"  ".5493865495485033"  "-.3250491744505147" ".6021572210001737"  "-.1148194976433514"
"01jul1979" "-1.30708522382794"  "-1.223489805063096" "-.4116313019725195" "-1.117990189600554" "-.7124749089488118" "-.9694497373400461" "-.6181518073800458" ".3616041072115909"  "-.5155554868413377" ".5590838024749157" 
"01oct1979" ".2576835507497248"  ".5058599426656887"  "-.9382794440484308" ".8218103477449816"  ".3816088234371109"  ".2889721980378507"  ".8627471266088126"  "-.1059045100902682" "-1.135745862631755" "-.6183935917493396"
"01jan1980" "-.8324074994883689" "-1.337397896369273" ".0532806322915055"  "-.083061147371501"  "-.8821590677511137" "-1.007399801233128" "-.4365655168989462" "-.1789527315436837" ".6392563974414134"  "1.311364712442127" 
"01apr1980" "-1.42534357567006"  "-.987253345265836"  "-1.39917939432807"  "-.8916236556492501" "-1.07013325557904"  "-.2091086172596979" "-.037431170760367"  "1.384279207559408"  "-.1453281309984123" ".9781453313311493" 
"01jul1980" "-4.657974857582793" "-4.364649786811445" "-3.138536278701797" "-2.774413417053343" "-4.495453032323069" "-3.043776270985513" "-2.900733008241692" ".9459898788389149"  "-1.94999924279101"  "-1.109604869661429"
"01oct1980" ".4433066902882825"  "1.051562784679944"  ".7518489179100984"  "-1.188831976709037" ".118880517460229"   "-.2164751983685571" "-.2486913371511683" "-.8948253017871557" "-1.074395006560139" "-.6428196697394695"
"01jan1981" ".8234674590138357"  ".5923410920163286"  "1.566894747669301"  "-.2944443236022168" "1.300291739167926"  ".0200933596691783"  ".4473166161982164"  ".0548015771072459"  "-.0772395022088895" ".7527876517506704" 
"01apr1981" "-.7022921580709627" ".5230786083406452"  "-2.992492524153477" ".3939501176500299"  "-.0196264544110912" ".435629420486675"   ".4194349092956191"  ".9459898788389149"  ".1431054920374995"  "-1.177694442966256"
"01jul1981" "-1.197697084752666" "-1.805391093560176" "-.2613700227210714" "-.224485637248193"  "-.0785615608123061" "-.18826901181601"   ".4216888215305774"  "1.325840630396675"  "-.0142435241326911" ".1997156394563981" 
"01oct1981" "-.5098691944679384" ".5861214071799972"  "-1.713327905471572" "-.5346286430459563" "-.4300193707735835" ".3089651062707783"  ".5586267167336916"  "-.4711456173573458" "-.6091179510140569" "-.0021147525558502"
"01jan1982" "-2.248065097353864" "-3.008664602207005" "-1.300923716176038" "-.2989424925959592" "-.5965395604414483" "-.8956190825151222" ".5622122803603822"  ".8437223688041334"  "-1.46654405347657"  "-.3916211789602886"
"01apr1982" "-.0974175576656333" ".6349895923030767"  "-.6299796919793881" "-.5795861768007562" "-1.771270894801755" "-1.262769174384168" "-1.60900227695349"  "-.1935623758343668" "-1.319542103153116" "-.2858201448650307"
"01jul1982" "-.7481796823212296" "-.3221311708554751" "-.5508415978831473" "-1.088799720463149" "-1.954300899834268" "-1.958273669887708" "-2.129809652019233" ".0109726442351966"  "-.5751232968697603" ".1533824441781703" 
"01oct1982" "-.1969757132320966" "-.1697314715436273" "-.0810959251682326" "-.2391627268299302" "-1.586674952745303" "-1.154541580423149" "-2.007514483821517" ".7414548587693517"  "-.8270844673672986" "-.1367727619468594"
"01jan1983" "1.420813768752577"  "1.089052207181701"  "1.588949158190317"  ".6039977894947873"  "-.4236002359842029" "-1.133311368422335" "-1.426643249152767" "1.194353831780528"  "-1.198179307332696" "-.4693108662474265"
"01apr1983" ".2810884072434068"  "-.0996750844081976" "1.133796486876347"  "-.3915984396721146" ".6007392619845878"  "-.7149333663406687" "-1.312528052687984" ".7122355701879854"  ".0733775337841033"  ".7271861694636627" 
"01jul1983" "1.843757869197683"  "1.976310853898541"  "1.198622811908769"  ".8170022400961375"  "1.298255994810679"  "1.230164582715647"  ".1088688959481162"  ".8875513016761827"  ".8448609133310636"  ".3364516034806304" 
"01oct1983" "1.482607160920874"  ".854458266526483"   "1.440378609498222"  "1.303416949138213"  "2.13077387364403"   "1.429757173486287"  "1.459445793582445"  "1.325840630396675"  "1.640138612052191"  ".2343754563478202" 
"01jan1984" "1.185335587048806"  "1.214761959626268"  ".4860301306858448"  ".8815955607673845"  "2.117433318571905"  "2.445150725572"     "2.319282170973286"  "-2.034377556460438" "1.300404126652442"  "-1.53469623461745" 
end
The actual dataset is much larger, namely I have 250 series, and the group number is indicated above. There are in total 14 groups, and I would like to first get the data in a long format (otherwise wide if long is not possible), and then create a group variable to assign each series to their respective group. I am aware of the reshape command to adjust this data to get the proper format, but with this kind of complicated dataset I am a bit confused where to begin.

If anyone has a clue on how to do this, I would really appreciate it.

Kind regards,

Ryan
Viewing all 65488 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>