Search results

  1. J

    bootstrapping - change in time using complex survey

    Hi, My problem seems simple, but I'm a bit lost. I have two variables, X1 and Y1. X1 and Y1 are the way a product is classified by the team X1 and Y1. X1: team X1 coding Y1: team Y1 coding And I need to test if the change (relative) between t and t+12 is different or not when I compare X1 and...
  2. J

    lapply and svyratio

    Hello, I need to compute some ratios using a survey. I manage to calculate regional totals after especifying a list of variables (regions). Regions are dummies from 1 to 17, taking the value of 1 if the observation belongs to the region1. This code works. It computes totals by regions using the...
  3. J

    Matrix rownames from variable levelsof

    Hello, I'm writing a code and I need to name the matrix row names with the local created from levelsof applied to var1 (variable 1). I already created the matrix using as reference a local (levels) using levelsof length. I tried something simple as this matrix rownames=`levels' Stata returned...
  4. J

    concatenate - Loop with variables

    Hello, I have a data frame. I generated some dummies using a simple loop. However, I can't concatenate the dummies to the original data frame. yyy=max(region) for (i in 1:yyy) { nam=paste("region",i,sep="") assign(nam,as.numeric(cise>0 & region==i))...
  5. J

    How can I report common strings in array/dataframe

    Hello, I have no idea how to report in a vector the commons variables from a data.frame or matrix. I have a data many columns. In this example I show four columns with d1-d4 as names. So, how do I create a vector with the common strings? Something as this: It looks simple, but...
  6. J

    Loop exporting to excel file- writeWorksheetToFile

    Hi, I need to read multiple dta files and exporting the content of a variable called "name". My idea is to aggregate to the right each "name" from each dta file. I made a simple loop and I know It works reading the dta files. However, It can't say the same exporting the data. Here is what I...
  7. J

    Import and working with labels from SPSS file

    Hi, It's been a while since I asked this, so I will try again: Is there any form to import a SPSS file on R but in the way SPSS deals with them? I mean, working with labels? R and the packages that provides the import tool just import one way the spss file. The numbers or labels, but not both...
  8. J

    GET DATA loop through folder

    Hi I need to run the same syntax over some files. They are in the folder named DBase. I mean, there is a db01.sav and over it run the syntax, then do the same for db02.sav and so on. How do i make it? How run the process only listing one time the files i'm interested? Thanks for your time...