下载游戏出现乱码了个游戏 出现 Error5899:Metadata filemissin…

SAS Learning Module:
Subsetting data in SAS
SAS Learning Module
Subsetting data in SAS
1. Introduction
This module demonstrates how to select variables using
the keep and drop statements, using keep and drop data
step options records, and using the subsetting if and delete
statement(s).
Selecting variables: The SAS file structure is similar to a spreadsheet. Data
values are stored as variables, which are like fields or columns on a spreadsheet.
Sometimes data files contain information that is superfluous to a particular analysis, in
which case we might want to change the data file to contain only variables of interest.
Programs will run more quickly and occupy less storage space if files contain only
necessary variables. The following program builds a SAS file called auto.
(For information about creating SAS files from raw data, see the SAS Learning Module on
LENGTH make $ 20 ;
INPUT make $ 1-17 price mpg rep78 hdroom trunk weight length turn
AMC Concord
121 3.58 0
258 2.53 0
AMC Spirit
3799 22 . 3.0 12
121 3.08 0
131 3.20 1
121 3.64 1
Buick Century
196 2.93 0
Buick Electra
350 2.41 0
Buick LeSabre
231 2.73 0
Buick Opel
4453 26 . 3.0 10
304 2.87 0
Buick Regal
196 2.93 0
Buick Riviera
231 2.93 0
Buick Skylark
231 3.08 0
Cad. Deville
425 2.28 0
Cad. Eldorado
350 2.19 0
Cad. Seville
350 2.24 0
Chev. Chevette
231 2.93 0
Chev. Impala
250 2.56 0
Chev. Malibu
200 2.73 0
Chev. Monte Carlo
200 2.73 0
Chev. Monza
151 2.73 0
Chev. Nova
250 2.56 0
Datsun 200
119 3.89 1
Datsun 210
Datsun 510
119 3.54 1
Datsun 810
146 3.55 1
Dodge Colt
Dodge Diplomat
318 2.47 0
Dodge Magnum
318 2.47 0
Dodge St. Regis
225 2.94 0
Fiat Strada
105 3.37 1
Ford Fiesta
Ford Mustang
140 3.08 0
Honda Accord
107 3.05 1
Honda Civic
Linc. Continental
400 2.47 0
Linc. Mark V
400 2.47 0
Linc. Versailles
302 2.47 0
Merc. Bobcat
140 2.73 0
Merc. Cougar
302 2.75 0
Merc. Marquis
302 2.26 0
Merc. Monarch
250 2.43 0
Merc. XR-7
302 2.75 0
Merc. Zephyr
140 3.08 0
350 2.41 0
Olds Cutl Supr
231 2.93 0
Olds Cutlass
231 2.93 0
Olds Delta 88
231 2.73 0
Olds Omega
231 3.08 0
Olds Starfire
151 2.73 0
Olds Toronado
350 2.41 0
Peugeot 604
12990 14 . 3.5 14
163 3.58 1
Plym. Arrow
156 3.05 0
Plym. Champ
Plym. Horizon
105 3.37 0
Plym. Sapporo
6486 26 . 1.5
119 3.54 0
Plym. Volare
225 3.23 0
Pont. Catalina
231 2.73 0
Pont. Firebird
231 3.08 0
Pont. Grand Prix
231 2.93 0
Pont. Le Mans
231 2.93 0
Pont. Phoenix
4424 19 . 3.5 13
231 3.08 0
Pont. Sunbird
151 2.73 0
Renault Le Car
Toyota Celica
134 3.06 1
Toyota Corolla
Toyota Corona
134 3.05 1
163 2.98 1
VW Scirocco
PROC CONTENTS DATA=
The proc contents
provides information about the file.
CONTENTS PROCEDURE
Data Set Name: WORK.AUTO
Observations:
Member Type:
Variables:
-----Alphabetic List of Variables and Attributes-----
------------------------------------
2. Subsetting variables
For example, if we wanted to examine the relationship
between mpg and price for various makes,
but had no interest in the automobile's dimensions, we could create a smaller
file, by keeping only these three variables.
DATA auto2;
To verify the contents of the new file, run
the proc contents command again.
PROC CONTENTS DATA=AUTO2;
CONTENTS PROCEDURE
Data Set Name: WORK.AUTO2
Observations:
Member Type:
Variables:
-----Alphabetic List of Variables and Attributes-----
-----------------------------------
Note that the number of observations, or records,
remains unchanged. This program makes a smaller version of auto called
that just has the three variables make mpg and
The new file, named auto2, is identical to auto except
that it contains only the variables listed in the keep statement. To compare the contents
of the two files, run proc contents on each.
PROC CONTENTS DATA =
PROC CONTENTS DATA = auto2;
The output is shown below.
CONTENTS PROCEDURE
Data Set Name: WORK.AUTO
Observations:
Member Type:
Variables:
-----Alphabetic List of Variables and Attributes-----
------------------------------------
CONTENTS PROCEDURE
Data Set Name: WORK.AUTO2
Observations:
Member Type:
Variables:
-----Alphabetic List of Variables and Attributes-----
-----------------------------------
Conversely, we can obtain the same results by using the drop
statement.
DATA auto3;
DROP rep78 hdroom trunk weight length turn
The keep statement names variables to
include, while the drop statement names variables to exclude.
Proc contents confirms the
PROC CONTENTS DATA = auto3;
CONTENTS PROCEDURE
Data Set Name: WORK.AUTO3
Observations: 74
Member Type:
Variables:
-----Alphabetic List of Variables and Attributes-----
-----------------------------------
Notice that the number of observations in all the
examples above remain constant.
The keep and drop statements control the selection of variables only.
3. Subsetting observations
The above illustrates the use of keep
and drop statements and data step options to select variables.
The subsetting if is typically used to
control the selection of records in the file. Records, or observations in SAS, correspond
to rows in a spreadsheet application.
The auto file contains a variable rep78
with data values from 1 to 5, and missing, which we ascertain from running the
following program.
PROC FREQ DATA =
TABLES rep78 / MISSING ;
Cumulative
Cumulative
---------------------------------------------------
Note that this program includes the / missing
option on the tables statement. Without it, SAS will print only
frequencies for non-missing values.
If we are only interested in cars with data for rep78
is not missing, we may eliminate records with missing data from the file by using a subsetting
DATA auto2;
IF rep78 ^= . ;
This program creates a new file auto2
which will be identical to auto, except that it will include only
observations where rep78 has a value other than missing.
proc freq verifies the change.
PROC FREQ DATA=auto2;
TABLES rep78 / MISSING ;
Cumulative
Cumulative
---------------------------------------------------
The subsetting if specifies which
observations to keep, i.e., only cars with data for rep78.
Alternately,
we may use the delete statement to specify which observations to
eliminate from the file.The following program keeps in the output file only cars with repair ratings of
3 or less.
DATA auto2;
IF rep78 & 3 THEN DELETE ;
Let's check the results using proc freq.
PROC FREQ DATA = auto2;
TABLES rep78 / MISSING ;
Cumulative
Cumulative
---------------------------------------------------
Using the subsetting if
statement as follows yields the same result.
DATA auto2;
IF (rep78 &= 3);
The results from proc freq
confirm this.
PROC FREQ DATA = auto2;
TABLES rep78 / MISSING;
Cumulative
Cumulative
---------------------------------------------------
Note that missing values are included, since
missing values are smaller than any other value. To delete missing values,
change the program as follows.
DATA auto2;
IF (rep78 &= 3) AND (rep78 ^= .);
Proc freq confirms that
missing values have been deleted.
PROC FREQ DATA = auto2;
TABLES rep78 / MISSING ;
---------------------------------------------------
4. Problems to look out for
When you create a subset of your original data, sometimes
you may drop variables or cases that you did not intend to drop.
If you find
variables or cases are gone that should not be gone, double check your subsetting
5. For more information
For information on making SAS data files from raw data
For information about making permanent SAS data files,
For more advanced issues in subsetting, data
transformations and data manipulation see
in the SAS Library- Web page resources
6. Web notes
You can view the SAS program associated with this module
by clicking .
While viewing the file, you can save it by choosing File
then Save As from the pull-down menu of your web browser.
In the Save
As dialog box, change the file name to subset.sas and then
choose the directory where you want to save the file, then click Save.
The content of this web site should not be construed as an endorsement
of any particular web site, book, or software product by the
University of California.为什么我玩CS1.5会出现错误报告.
CS1.5出现错误报告怎么回事
来源:网络
关键字: cs1.5会出现错误报告
更新时间:
延伸:本文除了聚合《为什么我玩CS1.5会出现错误报告.》,免费提供的有关cs1.5会出现错误报告和CS1.5出现错误报告怎么回事的内容之一,已有不少的网友认为此***对自己有帮助!
网友1的回答
你能不能把错误的具体情况描述一下?网友2的回答
意思是你的物理内存太小,CS运行至少需要16M的内存。 1 检查你 C盘是不是满了。吧C盘清理一下。网友3的回答
CS 问题大全!及CS相关下载. (37个问题) 上互动论坛混时间也不算太长,回复求助帖子无数。 现网友4的回答
1,计算机-右键-属性-高级系统设置-性能 设置-数据执行保护-添加cstrike.exe 然后重启网友5的回答
右键点击CS运行程序(cstrike.exe),点属性,选择兼容性,勾选“以兼容模式运行这个程序”,网友6的回答
你的系统应该是64的吧 处理方法:右击cstrike.exe----属性----兼容性-------网友7的回答
以兼容模式(xp)运行,很容易就解决了 右键 cstrike.exe属性兼容性以兼容模式网友8的回答
该内存不能read 或written数值 叙述 0 0x0000 作业完成。 1 0x0001 不正网友9的回答
建议直接卸载原有CS,这样更好,重新***一次175平台***的插件对于原有的CS版本会有影响,你需要将175平台的所有插件清理干净,这样就可以重新进入了网友7的回答
猜你感兴趣
相关关键词

参考资料

 

随机推荐