Transforming panel data variables (from Excel/Stata) to multiple matrices in Matlab
    7 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Martin Pott
 il 2 Lug 2014
  
    
    
    
    
    Commentato: Shuichi Obuchi
 il 21 Gen 2022
            I would like to know if it is possible to go from my Excel/Stata dataset to variables in matrix form.
My problem is as follows: I have been working on my thesis in Stata, and therefore my data is formatted as can be seen in the image attached. However, I will use a Matlab code that will need a number of variables of interest (e.g. return) to be formatted as a matrix with t*n dimensions.
This means, for variable 'return', that I would like the variable return to look like this: [ret_n1_t1 ret_n2_t1 ret_nN_t1; ret_n1_t2 ret_n2_t2 ret_nN_t2; ret_n1_tT ret_n2_tT ret_nN_tT]
Where n is the observation, N is the number of observations, t is period and T is number of periods.
I apologize if this question is already asked before, but I am not sure what to search for in order to find it.
Thanks in advance.
EDIT: gvkey is my firm identifying variable and time is the time-variable.

0 Commenti
Risposta accettata
  Martin Pott
 il 3 Lug 2014
        1 Commento
  Shuichi Obuchi
 il 21 Gen 2022
				Matlab did not have long to wide funciton such like stata did it.   I was looking for such fuction in Matlab. Your comment help me stop searching funciton.
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Text Files in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

