Displaying 1 result from an estimated 1 matches for "lw4".
Did you mean:
ld4
2012 May 31
2
Loop question
...i] <- Lx$Lb2[i+1]/Lx$Lb2[i]
Lx$sb3[i] <- Lx$Lb3[i+1]/Lx$Lb3[i]
Lx$sb4[i] <- Lx$Lb4[i+1]/Lx$Lb4[i]
Lx$sb5[i] <- Lx$Lb5[i+1]/Lx$Lb5[i]
Lx$sw1[i] <- Lx$Lw1[i+1]/Lx$Lw1[i]
Lx$sw2[i] <- Lx$Lw2[i+1]/Lx$Lw2[i]
Lx$sw3[i] <- Lx$Lw3[i+1]/Lx$Lw3[i]
Lx$sw4[i] <- Lx$Lw4[i+1]/Lx$Lw4[i]
Lx$sw5[i] <- Lx$Lw5[i+1]/Lx$Lw5[i]
}
How I could also create the variable names (letters b and w, and
numbers from 1 to 5 in s and L variables) using a loop in R?
In Stata I can use this command:
foreach r in b w {;
foreach s of numlist 0(5)40 {;
foreach e...