Thanks for generous and excellent answers, but I think that d1, d2, d3 were misunderstood (since I did not realize that d1,d2,d3... usually is used to denote different data frames). At my current beginner skill level I am totally fine with anything that works.
Actually, d1, d2, d3 are "numeric" wavelet decomposed variables (that is different wavelet time-scaled variables for each "numeric" variable).
There are 3 of these (d1,d2,d3) in ln_income1, 3 of these (d1,d2,d3) in ln_income2 etc,...,3 of these (d1,d2,d3) in ln_income100.
Maybe it is easiest for everyone if I give you the code I am using (here with the wage variables).
In the imported Stata file emilija3.dta I have the variables wage1, wage2,...,wage100.
In order to be even clearer, I have added a suffix to the d1, d2, and d3, that is d1_wage1, d2_wage1, d3_wage1, d1_wage2, d2_wage2, d3_wage2...... d1_wage100, d2_wage100, d3_wage100.
All of these wavelet transformed "numerics" can be saved in the same data frame. That is, this is just different time-scales of each variable.
Here is what I am trying to do (did it for wage this time, instead of ln_income):
# wage1
library(foreign)
edata <- read.dta("c://test//emilija3.dta")
wage1=edata$wage1
library(waveslim)
wage1.haar <- mra(wage1, "haar", 3, "modwt")
names(wage1.haar) <- c("d1", "d2", "d3")
d1_wage1=wage1.haar$d1
d2_wage1=wage1.haar$d2
d3_wage1=wage1.haar$d3
d1_wage1
d2_wage1
d3_wage1
####################
# wage2
library(foreign)
edata <- read.dta("c://test//emilija3.dta")
wage2=edata$wage2
library(waveslim)
wage2.haar <- mra(wage2, "haar", 3, "modwt")
names(wage2.haar) <- c("d1", "d2", "d3")
d1_wage2=wage2.haar$d1
d2_wage2=wage2.haar$d2
d3_wage2=wage2.haar$d3
d1_wage2
d2_wage2
d3_wage2
####################
# wage3
library(foreign)
edata <- read.dta("c://test//emilija3.dta")
wage3=edata$wage3
library(waveslim)
wage3.haar <- mra(wage3, "haar", 3, "modwt")
names(wage3.haar) <- c("d1", "d2", "d3")
d1_wage3=wage3.haar$d1
d2_wage3=wage3.haar$d2
d3_wage3=wage3.haar$d3
d1_wage3
d2_wage3
d3_wage3
####################
#...
#...
#...
####################
# wage100
library(foreign)
edata <- read.dta("c://test//emilija3.dta")
wage100=edata$wage100
library(waveslim)
wage100.haar <- mra(wage100, "haar", 3, "modwt")
names(wage100.haar) <- c("d1", "d2", "d3")
d1_wage100=wage100.haar$d1
d2_wage100=wage100.haar$d2
d3_wage100=wage100.haar$d3
d1_wage100
d2_wage100
d3_wage100
####################
Is there a loop (or something more elegant if you like) that can solve this so that I do not need to do this 100 times for every variable?
Many thanks from a beginner in R. I am not concerned about the speed of the "program".
All answers are welcome!
P