BookmarkSubscribeRSS Feed
danmet
Calcite | Level 5

Hej everybody.

I have a quick question on how to efficiently create a test data set.

I am working remotely with confidential data and I would like to create a fake data set with the same data structure so that I can do some programming on my local computer. As potentially many tables are affected, I would like to automatize this procedure as far as possible. Basically, I would like to do the following:

1. generate some code that creates a data set with the same variables/data types (a simple proc sql- describe table may do?)

2. save mean, std, and correlations (of number variables) and detect string data types of other variables.

3. create random data with the same of the statistical attributes of the original data.

4. the code should be flexible so that I can adjust it easily for different tables.

Any help is highly appreciated!!

Thanks

Daniel

2 REPLIES 2
ballardw
Super User

The first part is easy:

Data want;

     set have (obs=0);

run;

Creating fake data with mean and std is quite possible. Correlation I'm not so sure of, especially if you want to mantain correlation from  variable x to y1, y2, y3, etc. As when you create the dummy X you have a lot of constraints on the other variables that will be an interesting challenge.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Could you not just annonymize the data you have, so anything identifiable would be replaced with some code + random number?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1807 views
  • 0 likes
  • 3 in conversation