Professional Documents
Culture Documents
Ajay Ohri
Delhi, IN
This edition first published 2020
© 2020 John Wiley & Sons, Inc.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system,
or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording
or otherwise, except as permitted by law. Advice on how to obtain permission to reuse material
from this title is available at http://www.wiley.com/go/permissions.
The right of Ajay Ohri to be identified as the author of this work has been asserted in accordance
with law.
Registered Office
John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, USA
Editorial Office
111 River Street, Hoboken, NJ 07030, USA
For details of our global editorial offices, customer services, and more information about Wiley
products visit us at www.wiley.com.
Wiley also publishes its books in a variety of electronic formats and by print‐on‐demand. Some
content that appears in standard print versions of this book may not be available in other formats.
10 9 8 7 6 5 4 3 2 1
This book is dedicated to my students and my family, my son Kush Ohri,
members of my church, and my God Jesus Christ.
vii
Contents
Preface xiii
Scope xiv
Preface
I would like to thank the generosity of the SAS Institute and its employees
to provide SAS On Demand for Academics for free without whom this book
would not exist. In addition, I also want to thank the baristas from Starbucks
Gurgaon. These are the people who downvote my questions on Stackoverflow.
You inspire me guys.
SAS for R users is aimed at entry‐level data scientists. It is not aimed at
researchers in academia nor is it aimed at high‐ end data scientists working on
Big Data, deep learning, or machine learning. In short, it is merely aimed at
human learning business analytics (or data science as it is now called).
Both SAS and R are widely used languages and yet both are very different.
SAS is a programming language that was designed in the 1960s which is broadly
divided into Data Steps and a wide variety of Procedure or PROC steps, while
R is an object oriented, mostly functional, language designed in the 1990s.
There are many, many books covering either but only very few books
covering both.
Why then write the book? After all, I have written two books on R, and one
on Python for R. SAS language remains the most widely used language in
enterprises, contributing directly to the brand name, and profitability of one
of the largest private software companies that invests hugely in its own research
instead of borrowing research in the name of open source. A statistics student
knowing Python (esp Machine Learning ML), R, SAS, Big Data (esp Spark ML),
Data Visualization (using Tableau) is a mythical unicorn unavailable to
recruiters who often have to settle for a few of these skills and then train them
in house.
As a teacher, I want my students to have jobs – there is no ideological tilt to
open source or any company here. The probability of students getting jobs
from campus greatly increases if they know BOTH SAS and R not just one of
them. That is why this book has been written.
xiv
Scope
This book is designed for professionals and students; people who want to enter
data science and who have a coding background with some basics of statistical
information. It is not aimed at researchers or people who like giraffes and do
not read the book from the beginning.
1
1.1 About SAS
SAS used to be called the Statistical Analysis System Software suite developed
by the SAS Institute for advanced analytics, business intelligence, data man-
agement, and predictive analytics. Developed at North Carolina State
University from 1966 until 1976, when the SAS Institute was incorporated. It
was then further developed in the 1980s and 1990s with the additional statisti-
cal procedures and components. SAS is a language, a software suite and a com-
pany created by Anthony James Barr and James Goodnight along with two
others. For purposes of this book we will use SAS for SAS computer language.
●● SAS also provides a graphical point and click user interface for non‐technical
users.
While a graduate student in statistics at North Carolina State University,
James Goodnight wrote a computer program for analyzing agricultural data.
After a few years, James’s application had attracted a diverse and loyal
following among its users, and the program’s data management and reporting
capabilities had expanded beyond James’s original intentions.
In 1976, he decided to work at developing and marketing his product on a
full‐time basis, and the SAS Institute was founded. Since its beginning, a dis-
tinguishing feature of the company has been its attentiveness to users of the
software. Today, the SAS Institute is the world’s largest privately‐held software
company, and Dr. James Goodnight is its CEO. He continues to be actively
involved as a developer of SAS System software as well as being one of the most
widely respected CEOs in the community.
SAS for R Users: A Book for Data Scientists, First Edition. Ajay Ohri.
© 2020 John Wiley & Sons, Inc. Published 2020 by John Wiley & Sons, Inc.
2 SAS for R Users
1.1.1 Installation
While SAS Software for Enterprises is priced at an annual license, for students,
researchers and learners you can choose from the SAS University Edition
(a virtual machine) at https://www.sas.com/en_in/software/university‐edition.
html or SAS on Demand at https://odamid.oda.sas.com/SASLogon/login
(a software as a service running SAS in browser).
To install the SAS University Edition on your Virtual machine you can follow
the following steps (I am using VMware Workstation for this):
●● Run your Virtual Machine and click on file.
●● Open and select SAS University Edition (the extension of the file should
be .ova). You can provide a new name and storage path for your new Virtual
Machine and then import.
●● Now, you need to initially run the virtual machine and use the link provided
in the VM to connect to the SAS University Edition in your browser.
1.2 About R
R is a language and environment for statistical computing and graphics. It is
a GNU project which is similar to the S language and environment which was
developed at Bell Laboratories (formerly AT&T, now Lucent Technologies)
by John Chambers and colleagues. R can be considered as a different imple-
mentation of S. R was initially written by Robert Gentleman and Ross Ihaka.
About SAS and R 3
1.2.2 Installation of R
You can download and install R from https://www.r‐project.org (or specifically
from https://cloud.r‐project.org for your operating system). You can then
download and install the IDE RStudio from https://www.rstudio.com/
products/rstudio/download/#download. Lastly, you can install any of 12 000+
packages (see https://cran.r‐project.org/web/views and https://www.
rdocumentation.org) using install.packages(“PACKAGENAME”) from
within R. These packages can be downloaded from the CRAN (Comprehensive
R Archive Network).
Within https://www.datacamp.com/community/tutorials/r‐packages‐guide,
R packages are collections of functions and datasets developed by the com-
munity. They increase the power of R either by improving existing base
R functionalities, or by adding new ones. For example, you can use sqldf
package to use SQL with R and RODBC package to connect to RDBMS
databases.
In addition, an excellent resource is how to learn SAS for R users from
the SAS Institute itself.
https://support.sas.com/edu/schedules.html?ctry=us&crs=SP4R
4 SAS for R Users
data ajay;
set input;
run;
b) Proc Step which are procedural steps for analysis and output.
Function SAS R
Import data proc import read_csv (readr package)
Print data proc print ajay
data=ajay;
run;
Structure proc contents str(ajay)
of Data data=ajay;
Object run;
Frequency of proc freq data= table(ajay$var1,ajay$var2)
Categorical ajay;
Variables tables var1*var2;
(Cross run;
Tabulation)
Analysis of Proc means summary(ajay$var1,ajay$var2)
Numerical Proc means data=
Variables ajay; library(Hmisc)
without/ Var var1 var2; summarize(ajay$var1,ajay$grp
with Run; 1,summary)
grouped by
another Proc means summarize(ajay$var1,ajay$grp
variable daya=ajay; 1,summary)
Var var1 var2;
Class grp1;
run;
1.5 Summary
In this chapter we have introduced R and SAS languages, and briefly compared
their main functions/syntax.
4 Who designed R?
8 TASK: Suppose you know SQL. Can you identify functions or packages you
can use in SAS and R respectively to run SQL commands?
Quiz Answers
1 JAMES GOODNIGHT
2 1976
5 1993
6 UNIVERSITY OF AUCKLAND
7 SAS
2.1 Importing Data
Importing data is the first step in analyzing data. It is important that you
have reliable and relevant data. You should be able to import data correctly
because the computer processes what data you input. If the imported data is
faulty, the analysis that you will receive after performing various tasks on it will
also be erroneous and misleading.
This concept is also commonly known as GIGO (Garbage In Garbage OUT).
Therefore, the input step is one of the most important steps in the data science
pipeline. There could also be different ways to input data in R and SAS from
files or from data connections. Importing of datasets calls for certain functions
in R whereas it calls for certain procedures for the same in SAS.
2.1.1 Packages in R
Importing of data in R can be done using certain packages and functions, and
to use those packages, we need to install them in our application.
Installing a package has the following command in R:
install.packages(“package_name”)
After installation to use this package you must load that package. Loading
a package means getting the package in active state (session). To load a
package use:
library(“package_name”)
SAS for R Users: A Book for Data Scientists, First Edition. Ajay Ohri.
© 2020 John Wiley & Sons, Inc. Published 2020 by John Wiley & Sons, Inc.
8 SAS for R Users
Updating a package:
update.packages(“package_name”)
Note that we install the package only once, we update it occasionally and we
load it every time we begin a R session. To unload a package, we use:
detach.packages(“package_name”)
uninstall.packages(“package_name”)
data first;
infile datalines
input m n;
datalines;
5 10
10 20
20 40
;
run;
Data Input, Import and Print 9
data second;
infile datalines
input name$ points;
datalines;
ajay 10
kush 9
;
run;
data third;
infile datalines missover dsd;
input m n o;
,2,3
4,,6
7,8,9
Here we use the proc. import step to import a raw data file and save it as an
SAS dataset. DBMS is used to specify the file type, e.g.: CSV, XLS etc.
getnames = yes is to specify that the first row contains column names.
Note: The type of dataset created (temporary or permanent) depends on the
name you specify in the out = statement.
A permanent dataset has to be referenced by a two‐level name: ‐ library_
name.data_set_name whereas a temporary dataset just has a one‐level
name.
data temp_setname;
set libname.permaset_name;
run;
2.3 Importing Data in R
There are a number of ways to import data into R, and several formats are
available:
1) From CSV files using readr or data. Table package
2) From Excel to R
3) From SAS to R
4) From SPSS to R
5) From Stata to R, and more
6) From Relational Databases (RDBMS) using RODBC
7) From json files using jsonlite package
https://rforanalytics.wordpress.com/useful‐links‐for‐r/odbc‐databases‐for‐r
Let us explore some of the ways to import data in R.
Data Input, Import and Print 11
read.csv("file_path.csv") or read.table("file_path.csv")
read_csv("file_path.csv")
fread("file_path.csv")
You can use the system. Time() function to verify that as follows:
system.time(read.csv("file_path.csv"))
system.time(read_csv("file_path.csv"))
system.time(fread("file_path.csv"))
install.packages("readxl")
library("readxl")
read_excel("file_path.xls")
12 SAS for R Users
Example: To import sheet 1 of an excel file with the first row as column
names
We can also use sheet names put within double quotes instead of the sheet
number to specify the sheet we want from any excel file.
install.packages("sas7bdat")
library("sas7bdat")
read.sas7bdat("file_path.sas7bdat")
install.packages("foreign")
library("foreign")
read.spss("file_path.spss")
read.dta("file_path.dta")
objectname=value;
or
objectname <‐ value;
objectname=read_csv("file_path",parameters)
Data Input, Import and Print 13
> ajay=c(11,2,30)
> ajay
[1] 11 2 30
We can do the same for other types of data except string variables which will
be in quotes (i.e. “ten”)
ajay=c(10,20,30,40)
dates2=c("26jun98","1/09/2005","1January2016")
newone=c("Raj","Shiva","Kamal","Ajay")
ajay2=c(23,45,78,NA,NA,89,NA)
is.na(ajay2)
## [1] FALSE FALSE FALSE TRUE TRUE FALSE TRUE
ajay3=data.frame(c("a","b"),c(1,2))
a 1
b 2
my_matrix = matrix(
c(2, 4, 3, 1, 5, 7),
nrow=3,
ncol=2)
This code makes a matrix with values in c() arranged in three rows and two
columns arranged column wise. Note: vector and matrix must have all values
of the same type but data frames can have values of different types.
ajay=NULL
for (i in 1:20) {
ajay[i]=i}
print(ajay)
Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
data first;
infile datalines
input m n;
datalines;
5 10
10 20
20 40
;
run;
data second;
infile datalines ;
input name$ points;
datalines;
ajay 10
kush 9
;
run;
data third;
infile datalines missover dsd;
input m n o;
datalines;
,2,3
4,,6
7,8,9
;
run;
Missover option is used to prevent the data step from going to the next line
if it does not find values for all variables in the input statement in the current
record. Here the dsd option is used to treat commas as separator characters.
16 SAS for R Users
2.6 Printing Data
After importing the data, the next important step is to print that data to have a
look at the type of data you now have to analyze.
run;
The code below will help you print the first five observations of the dataset
named ajaydat.
run;
The code below will help you print the observations ranging from 10 to 20
for dataset ajaydat.
run;
2.6.2 Print in R
In R, printing of data does not need any function or package. You simply write
the dataset name and then run it to print the data.
If you read data in mydata and write the data_set name:
The whole data in mydata will be printed at console.
mydata=read_csv("file_path")
mydata
Data Input, Import and Print 17
Only the first observation of mydata is printed to the console. Default value
of n is 6.
head(mydata,n)
mydata[10:20]
2.7 Summary
Importing data in R requires a variety of functions to import different types of
files whereas proc. import is used with different options or parameters to
import any type of file in SAS. Data input in R is done using the c() function
and using a data step with input option in SAS. In R, printing a dataset just
requires the writing of the name of the dataset and running it, whereas SAS
uses proc. print to print any dataset.
4 Which function in R can you use to measure the time taken by a code to
execute?
6 How can you create a temporary dataset from a permanent one in SAS
using a data step?
8 What is the missover option used for in the infile statement in a SAS data
step?
18 SAS for R Users
Quiz Answers
1 library(“package_name”)
2 read_csv(),fread(),read.csv()
3 readr, data.table
4 system.time()
5 proc. import
7 $
8 Missover tells SAS not to jump to the next line if it does not find values for
all variables. We just type the name of the dataset and run it to print a data
set in R.
10 proc print
19
3.1 Introduction
Data Cleaning and Inspection is the next important part of the data analysis
pipeline. It implies that before starting analysis, visualization or machine learn-
ing and its insights, you should have cleaned any data that has to be analyzed.
Though Machine Learning, Exploratory Data Analysis and Data Visualization
take up more time in analytical education, in an actual data science project
much more time is spent in data inspection and cleaning.
3.2 Data Inspection
Data inspection helps us determine that data import has been executed
correctly, that variables are in same length (rows) and breadth (columns) and
that variables (columns) are in the same format as expected.
/* Refer to a column by using var in proc and keeping it by keep in data step*/
data import4 (keep=ozone2);
set import3;
run;
SAS for R Users: A Book for Data Scientists, First Edition. Ajay Ohri.
© 2020 John Wiley & Sons, Inc. Published 2020 by John Wiley & Sons, Inc.
20 SAS for R Users
Printing only that variable by using var (which is also used in other Procs)
proc print data=import3 (obs=5);
var ozone2;
run;
data output1;
do i = 1, 3, 4, 7;
set import3 point = i;
output;
end;
stop;
run;
>class(airquality)
[1] "data.frame"
> summary(airquality)
Ozone Solar.R Wind Temp Month Day
Min. : 1.00 Min. : 7.0 Min. : 1.700 Min. :56.00 Min. :5.000 Min. : 1.0
1st Qu.: 18.00 1st Qu.:115.8 1st Qu.: 7.400 1st Qu.:72.00 1st Qu.:6.000 1st Qu.: 8.0
Median : 31.50 Median :205.0 Median : 9.700 Median :79.00 Median :7.000 Median :16.0
Mean : 42.13 Mean :185.9 Mean : 9.958 Mean :77.88 Mean :6.993 Mean :15.8
3rd Qu.: 63.25 3rd Qu.:258.8 3rd Qu.:11.500 3rd Qu.:85.00 3rd Qu.:8.000 3rd Qu.:23.0
Max. :168.00 Max. :334.0 Max. :20.700 Max. :97.00 Max. :9.000 Max. :31.0
NA’s :37 NA’s :7
> class(airquality)
[1] "data.frame"
22 SAS for R Users
We can choose specific parts of a data frame by using square brackets, i.e.
●● airquality [2,3] gives data in second row and third column of airquality
●● airquality [2,] gives data in second row and all columns of airquality
●● airquality [,3] gives data in all rows and third column of airquality
●● airquality [R,C] gives data in Rth row and Cth column of airquality
airquality$Ozone gives value of Ozone column in airquality
3.3 Missing Values
Data that is missing can be due to human data input error, formatting issues or
incorrect coding syntax for import. It is a problem because we cannot have
analysis without data.
There are three ways to handle missing data:
1) Ignore it
2) Delete it
3) Replace it – Replace with a value that does not change the numerical prop-
erties significantly. Missing value imputation is the name given to replacing
missing data. At its simplest form we replace missing values by either mean
or median data. At its more sophisticated form, we use correlation from
other variables that are more complete to impute them. We can also use
machine learning algorithms to impute data from other variables. Specific
packages like mice package in R help with more sophisticated missing value
imputation.
File Import
FILENAME REFFILE '/home/ajay4/book/airquality.csv';
Finding variable type. To our surprise many variables have been encoded as
string variables in SAS which were encoded as numeric in R. This is due to NA
being a character value in SAS but missing values in R. In SAS missing values are
denoted by a single period.
Data Inspection and Cleaning 23
Let’s print the first six rows of data (similar to head function in R)
proc print data =import (obs=6);
run;
data import2;
set import;
Ozone=compress(Ozone,"NA","");
Run;
Chars[i] = strip(Chars[i]);
if Chars[i] = "NA" then Chars[i] =. ;
end;
drop i;
24 SAS for R Users
Ozone2=input(Ozone,2.);
drop Ozone ;
Solar_R2=input(SolarR,3.);
drop SolarR ;
var2=input(VAR1,8.);
drop VAR1 ;
run;
Using nmiss we can find and ignore the missing values in proc means (similar to
na.rm. = T in R)
Suppose we ran the same Proc Means procedure but without nmiss, we will not
see the missing values (is.na = T in R).
Variable Mean
Wind 9.9575163
Temp 77.8823529
Month 6.9934641
Day 15.8039216
Ozone2 35.3017241
Solar_R2 185.9315068
var2
Data Inspection and Cleaning 25
But for character variables and others there is the following representation:
To simply omit all missing values (like na.omit in R) we use the following SAS
code:
data import21;
set import2;
if Ozone2=. then delete;
run;
You can see a few rows that also had solar_R2 have been deleted. Therefore, we
need to be careful about explicit deletion.
To replace missing values with the mean of the variable you can use the
following:
proc stdize data=import2 reponly method=mean out=import3;
var ozone2 solar_r2;
Run;
We see the mean and then check for mean with missing values ignored using
na.rm. = T. We also check for total missing values by is.na. In R, as we have
mentioned, missing values are given by NA
> mean(airquality$Ozone)
[1] NA
> table(is.na(airquality))
FALSE TRUE
874 44
> airquality2=na.omit(airquality)
> str(airquality)
> str(airquality2)
(which checks for missing value). If is.na is true, it indicates data is missing
value then we replace it by median of variable (ignoring missing values) and if
is.na is false we do not replace data but keep the original value. This is similar
to proc stdize
> data("airquality")
> summary(airquality$Ozone)
> airquality$Ozone=ifelse(is.na(airquality$Ozone),
median(airquality$Ozone,na.rm = T),airquality$Ozone)
> summary(airquality$Ozone)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.00 21.00 31.50 39.56 46.00 168.00
3.4 Data Cleaning
Here we try and clean various types of errors in a data type in both SAS and R.
We first input data using the SAS datalines way (corresponds to R’s c operator
for a list).
data money;
infile datalines ;
input name$ ;
datalines;
'50000'
'50,000'
'$50000'
50000
'50000'
'50000.00'
;
run;
30 SAS for R Users
Note /* test*/ shows a comment in SAS just like #test shows a comment in R
/* Obs name */
/* 1 '50000' */
/* 2 '50,000' */
/* 3 '$50000' */
/* 4 50000 */
/* 5 '50000.0 */
Here we use the compress function to get rid of junk values, $ ‘(just like gsub in R).
We also use the input function to convert character to numeric value just as we
did as.numeric function in R.
However, in SAS we have to specify format and informats to convert data types
from one to another. In R, we use lubridate, stringr package, and the as operator
to do so.
data money2;
set money;
name2=compress(name,",$'");
name3 = input(name2,6.);
run;
Proc means is like summary in R (however we can specify only one var by using
the var argument in SAS whereas in R we can use the $operator for single
variables
proc means data=money2;
var name3;
run;
> money=c('50000','50,000','$50000',50000,'50000.00')
> mean(money)
[1] NA
Warning message:
In mean.default(money) : argument is not numeric or logical:
returning NA
> str(money)
chr [1:5] "50000" "50,000" "$50000" "50000" "50000.00"
> money=gsub(',',",money)
> money
[1] "50000" "50000" "$50000" "50000" "50000.00"
> money=gsub('\\$',",money)
> money
[1] "50000" "50000" "50000" "50000" "50000.00"
> money=as.numeric(money)
> money
[1] 50000 50000 50000 50000 50000
> mean(money)
[1] 50000
> str(money)
num [1:5] 50000 50000 50000 50000 50000
Using the gsub package in R, it is easy to clean Data just as we used compress
in SAS. We have created a different variable every time we replace to avoid the
actual data to being lost and/or changed. Data cleaning is quite a simple pro-
cess in both R and SAS thanks to the inbuilt functions as well as documenta-
tion. What adds to the complexity is the volume and variety of the data both
Big and Small. You can also see data cleaning is an intensive manual task as
data errors can be of many types. It is estimated that out of many data science
projects as much as 80% of time is spent on data hygiene.
5 How will you clean data with junk values like $ and , in R?
6 How will you clean data with junk values like $ and , in SAS?
Quiz Answers
1 X.
2 NA.
3 Using ifelse
4 proc stdize
5 gsub
6 compress
7 proc contents
8 str
datasetname$variablename
33
So far, we have learnt how to import data and create your own data in R and
SAS, along with data inspection and cleaning. Here, we will learn how to work
with different kinds of data, for example, dates, strings and numbers and how
to convert one data format to another in both R and SAS. This includes han-
dling numeric data, manipulating string/character variables (i.e. by extracting
a substring of a string variable), handling different types of date format and
numeric calculations with dates (i.e. difference between dates) as well as cate-
gorical data.
data ajay2;
a="1234567";
Run;
SAS for R Users: A Book for Data Scientists, First Edition. Ajay Ohri.
© 2020 John Wiley & Sons, Inc. Published 2020 by John Wiley & Sons, Inc.
Another random document with
no related content on Scribd:
één woord, de vermaaken die te Muiderberg genoten worden zijn te talrijk
om ze allen te beschrijven, en te vol gewoel om er een wèl geordend
tafreel van te ontwerpen; allen helpen zij intusschen, zo als wij reeds
zeiden, den bloei van het plaatsjen niet weinig bevorderen.
’T is omtrent deeze plaats, omtrent dit dorpjen, dat, naar ’t gevoelen van
eenigen, Graaf Floris de Vijfde, door de zamengezworenen is
omgebragt; (zie onze beschrijving van Naarden, Art. Geschiedenissen,) ’t
geen anderen, doch verkeerdlijk, willen, dat op het Muiderslot zoude
geschied weezen, ’t geen echter van de beste Historieschrijvers wordt
tegengesproken, in navolging van welken de Puik-dichter Antonides van
der Goes, in zijnen Y-stroom, bladz. 108, ook zegt:
NAAMSOORSPRONG.
STICHTING en GROOTTE.
Wie Muiderberg eigenlijk gesticht of aangelegd zoude hebben, daarvan
zijn geene bescheiden voorhanden: oud moet het zekerlijk zijn, uit
aanmerkinge van den reeds gemelden Giftbrief van Graave Willem van
Henegouwen, geschreven in den jaare 1324; want daarin wordt het, gelijk
wij gezien hebben, reeds gespeld.
Wat de grootte betreft, volgends de lijsten der verpondingen van den jaare
1632, stonden er toen 34 huizen, doch honderd jaaren laater, in 1732,
bedroeg dat getal niet meer dan 28 huizen; weshalven het in de gezegde
honderd jaaren, 6 huizen verminderd is; thans zijn er weder 6 minder,
naamlijk slechts 22, het welk zeer ligtlijk het geval van dergelijke, schoon
bloejende, dorpjens kan worden, want die bloei bestaat gemeenlijk in niet
meer dan in eene genoegzaame broodwinning der bewooneren, ofschoon
het daarom anderen, elders woonende, niet geraaden zij, zig aldaar met er
woon te komen nederslaan, alzo zij welligt alles wat zij nog hadden
verteerd zouden hebben, [5]aleer zij gelegenheid kreegen om door hun
toedoen den bloei des dorpjens te vermeerderen, en derhalven zig zelven
in eenen bloejenden staat te bevinden.
Men schat het getal der inwooneren op omtrent 200, die, uitgenomen
eenige weinige Roomschgezinden, allen van den Gereformeerden
Godsdienst zijn.
Het schatbaar land onder het district van Muiderberg behoorende, wordt
begroot op niet meer dan honderd en vijftig morgen.
Dit Artijkel van ons plan betreffende kunnen wij, het tegenwoordige
dorpjen aangaande, niet anders noemen dan de kerk, want Wees- of
andere Gods-dienstige Gestichten zijn er niet voorhanden: de Weezen
worden er bij de inwooners besteed.
Van binnen is de kerk zeer zindelijk, doch ook zeer eenvoudig, hebbende
volstrekt niets dat men kan zeggen een cieraad te weezen; ook is er geen
orgel in.
Derzelver vertooning van buiten, maakt zeer geloofwaardig het geen men
er van aangetekend vindt, naamlijk dat het nog de capel zoude zijn welke
de Roomschen in vroegere eeuwen aldaar gehad hebben; zij heeft in alles
de gedaante van een capel, vooral van vooren; men gaat tot den ingang,
(er is ook maar één ingang aan) door een laantjen van boomen, waar
achter het bovenste gedeelte van de kerk zig verbergt: men wil dat dit
gebouw gesticht zoude weezen, door den reeds meergemelden Graaf
Willem van Henegouwen, de derde van dien naam; doch, en het geen
van zelf spreekt, als eene capel, welke bij de Reformatie van binnen tot
het oefenen van den Gereformeerden Godsdienst is toebereid.
Thans staat op het gebouw een vierkante toren, zijnde van boven geheel
plat; evenwel is dezelve zodanig niet altoos geweest; er heeft, zelfs nog in
de tegenwoordige eeuw, [6]een spits op gestaan, doch hetzelve is er door
een’ stormwind afgewaaid, en sedert is er geen ander spits op gezet.
WERELDLIJKE GEBOUWEN.
Onder dit artijkel kunnen wij niet anders brengen, dan het Rechthuis, dat
voor 3 jaaren een ruime Herberg was; doch sedert in een schoone lusthof
is veranderd. [7]
KERKLIJKE REGEERING.
WERELDLIJKE REGEERING.
De
BEZIGHEDEN
Der bewooneren, zijn meestal de landbouw, waartoe zij, gelijk wij hiervoor
reeds zeiden, goede gelegenheid hebben: het zaajen van boekwijt en
rogge, en het pooten van aardappelen, gaat er zeer sterk: voords vindt
men er eenigen van die werklieden welken in de burgerlijke zamenleving
volstrekt onontbeerelijk zijn.
GESCHIEDENISSEN,
Door het vuur heeft Muiderberg, voor zo verre wij hebben kunnen
naspooren, nooit veel geleden; ook niet door het water; want ofschoon het
nabij de zee gelegen zij, heeft de goeddoende en altijd zorgende Natuur
het dorpjen, door middel van vrij hoog duin tegen de woede van dat
element beveiligd.
„In den jaare 1673 hadden de Franschen,” dus luidt een gedeelte der
historie van dit dorp, „zig op Muiderberg verschanst en batterijen
opgeworpen tegen die van Muiden, welke stad zij toen onder hunne magt
hoopten te krijgen; zij werden echter van daar verdreven, door
verscheidene uitleggers op de Zuiderzee, die van Amsteldam gezonden
werden, en door vlotschuiten met kanon waarvan men drijvende batterijen
maakte, die hen van de vaart tusschen Muiden en Naarden zo
benaauwden, dat zij op den 6 Junij van ’t gemelde jaar opbraken, en
hunne onderneemingen lieten vaaren.”
BIJZONDERHEDEN,
Indien men zig nu plaatst op den afstand van drie- en- vijftig voeten van
het middenpunt des muurs, en een ander zeventien voeten ten westen
bezijden den eerstgemelden gaat staan, en dan zacht of hard, geheele
versen spreekt, beantwoordt de echo dezelven, niet achter elkander, maar
elk afzonderlijk, één voor één: dan, het verwonderlijkste van alles is, dat
de stem of de echo niet schijnt terug te komen van den muur, maar uit den
grond, zeer juist alle woorden nabaauwende.
Deeze echo is aldaar ontdekt voor bijna zeventig jaaren, toen de Heer
Homoet eigenaar dier plaatse was, en bij gelegenheid dat men eene
ligusterhegge uitroeide: intusschen is het zeker, dat in het Vaderlandsch
Treurspel, Gerard van Velzen, in het jaar 1613 in ’t licht gegeven, reeds
gesproken wordt van het verstoord gebeente van dit cirkelrond, en van de
echo, bij gevolg is deeze muur, (waartoe gemaakt weet men niet, mogelijk
tevens tot eene begraafplaats,) en dus ook deeze overschoone echo, al
vóór honderd een- en- dertig jaaren, bekend geweest, die daarna in het
vergeetboek geraakt kan zijn, toen deeze hofstede, uit de eene hand in de
andere overging, tot dat men, de ligusterhegge uitwerpende, dezelve
toevallig ontdekte.
REISGELEGENHEDEN.
Deezen zijn als die van Muiden, want van Amsteldam met de schuit tot
daar gekomen zijnde, vaart men met de Naarder schuit tot de
Hakkelaarsbrug, alwaar men uitstapt om verder naar Muiderberg te
wandelen—Terug gaat men weder, of naar Muiden, of naar de
Hakkelaarsbrug voornoemd, en zo verder op Amsteldam.
LOGEMENTEN,
Deeze zijn geene anderen dan de reeds gemelde plaats van den Heere
Abbema; voords zijn er nog twee herbergen van mindere rang. [1]
[Inhoud]
De stad Weesp.
Zo lang de Zilvren VECHT uw boorden blyft besproeien,
O WESOP! en Natuur u met haar schoon vereert.
Zo lang de Koopmanschap in Nederland zal bloeien;
GENEVER, en door Oost en Westen word begeerd.
—
Zo lang de Naneef TROUW op hogen prys zal stellen,
Hoort Gy, MYN VADERSTAD! uw naam met blydschap spellen.
B. P.—
DE
S TA D
WEESP.
NAAMSOORSPRONG.
STICHTING en GROOTTE.
Hoewel men den tijd der Stichting dezer Stad met geene zekerheid
bepalen kan; veel min of dezelve altijd met vestingen omringd of bevest
is geweest; kan men echter bewijzen dat zij in den Jaare 1131 reeds
bekend was, als blijkt uit zekeren brief van Andreas den
vijfentwintigsten Bisschop [2]van Utrecht, waarin van bovengemelden
Hero gewaagd word. In de handvest van Hertog Willem van Beieren in
’t Jaar 1355, word van Weesp het allereerst melding gemaakt, als van
eene Stad, voorzien met poorten en wallen, en hare Burgers Poorters
genoemd.
’T W A P E N .
Weesp heeft twee Wapens: te weeten het Oude en Nieuwe. Het oude
verbeeld een Kerk, met een’ grooten toren aan den Voorgevel en een’
kleiner’ in de midden: de figuur heeft veel [3]overeenkomst met het
tegenwoordig Kerkgebouw. Het nieuwe is een zilveren paal op een
blaauw veld. Het eerstgenoemde word noch ter bezegeling van brieven
of decreeten gebruikt.
De orde vereischt dat hier ter plaatse ook melding gemaakt worde van
de Stichting van wijlen den Heere Cornelis van Drosthagen, bij
beslotene laatste wille, 1714 gemaakt, en 1718 door zijn dood
bevestigd: volgends welke hij zijne Nalatenschap, bestaande in Huizen,
Landerijen enz onder het bestuur van drie Executeuren van de
Roomsche Religie gesteld heeft; zo nochthans dat bij het afsterven van
eenen derzelven een’ Gereformeerde door de aanblijvenden, in
deszelfs plaatse, mogt verkozen worden; welk laatste reeds sints een
aantal Jaaren heeft stand gegrepen.—De voordeelen, uit deeze
Goederen voordspruitende, moeten in drieën verdeeld worden, als aan
zijne behoeftige Vrienden van moeders zijde; aan het Arme Weeshuis,
en aan Armen der Roomsche Gezindheid. Ter gedachtenisse van
deezen Heer is in een gevel van een der vernieuwde Gebouwen een
steen geplaatst, waarop men het volgende versjen leest:
[6]
WAERELDLIJKE GEBOUWEN.
De Waag, een oud gebouw, voorheen een rondeel der Vestingen, reeds
in den Jaare 1407 geschikt tot het Stadhuis, waar toe het tot 1634
gebruikt is, staat aan de Vecht. Behalve dat dezelve tot het wegen der
Koopmanschappen enz. gebezigd word, strekt zij ook ter
Vergaderplaats van sommige Gilden: terwijl op een harer vertrekken
thans ook de Hoofdwacht der Militairen gehouden word. Derzelver
Voorgevel is niet onaanzienlijk, en pronkt met het Wapen der Stad.
REGEERING.